The built-in math functions and operators give poor results for small values of z. The BCMath version produces closer results, but still quite distant if z < 1. A BCMath version of the log function might help.