[Issue 23677] log1p Documentation Doesn't Match Implementation

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 27 15:45:37 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=23677

--- Comment #1 from John Hall <john.michael.hall at gmail.com> ---
It looks like my previous comment about CEPHES is in error. What is actually
happening is that the logImpl function has the CEPHES polynomials that are used
for log1p (at least I know it's true for doubles, I don't see them in the
CEPHES code for floats/long double, but I assume it is right).

In other words, the phobos log function seems to try to be more accurate for
values close to 1 in a way that is different from other programming languages
(which is why log1p is typically included as a separate function). 

I'm still showing some funky results for log1p(1.0e-15) vs. log1p(1.0e-16)
compared to when log1p did the calculation at real accuracy.

--


More information about the Digitalmars-d-bugs mailing list