Small library of useful mathematical functions