Address numeric problems in the log(1+x) functions
The function as implemented didn't account for extremely small inputs and returned incorrect results. This addresses the underlying issues in the re-implemention of the function. Also added a unit test case that highlights the problem.
Edited by Pauli