shibatch / sleef

SIMD Library for Evaluating Elementary Functions, vectorized libm and DFT
https://sleef.org
Boost Software License 1.0
661 stars 131 forks source link

FP32 `log1pf_u10` and FP64 `log1p_u10` are infinitely inaccurate for large inputs #473

Open ebavier opened 1 year ago

ebavier commented 1 year ago

On x86 targets and possibly others, the log1pf_u10 and log1p_u10 functions are infinitely inaccurate for large input values. Currently

No input value except x = inf should result in an inf result for log1p.

Relevant source:

https://github.com/shibatch/sleef/blob/85440a5e87dae36ca1b891de14bc83b441ae7c43/src/libm/sleefsp.c#L1761

https://github.com/shibatch/sleef/blob/85440a5e87dae36ca1b891de14bc83b441ae7c43/src/libm/sleefdp.c#L2179