Collection of useful mathematical functions