[Issue 15365] std.math: 80-bit exp() tests are utterly wrong when returning subnormals

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Nov 22 02:56:44 PST 2015


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

--- Comment #3 from Iain Buclaw <ibuclaw at gdcproject.org> ---
Stepped through the path dmd code uses for exp().

(1) 0x1.1p13L       - Uses L_normal path
(2) -0x1.18p+13L    - Uses L_normal path
(3) -0x1.625p+13L   - Uses L_normal path
(4) -0x1.62dafp+13L - Uses L_normal path

Interestingly, the last test exp(-11398) uses the L_subnormal path, and returns
results that are correct to wolfram in at least the bits that can be
represented.

Also tried exp(-11370) and exp(-11387.4), and on the surface it looks like any
near underflow/subnormal that represents a decimal will only be correct up to
double precision.

Also tested the first iteration of exp() and it returns the same results.

--


More information about the Digitalmars-d-bugs mailing list