add new logarithm code and fix minor precision issue in atan