Add more cmath functions, small exception handling difference