Good algorithm for calculating ln(1-x) for small (and occasionally large) x
-
04-10-2019 - |
Question
I'm looking for an algorithm to calculate ln(1-x). x is often small (<0.01), but occasionally it might be larger. Algorithm needs to be accurate, and not too slow. I'd rather not use library for ln(x), because I might lose accuracy.
OTHER TIPS
If you are using MATLAB the log1p() function was designed specifically for calculating ln(1+x) for small values of x.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow