shibatch / sleef

SIMD Library for Evaluating Elementary Functions, vectorized libm and DFT

Home Page:https://sleef.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

ebavier opened this issue · comments

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

  • log1pf_u10 (x > 1e38) = inf, and
  • log1p_u10 (x > 1e307) = inf

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

Relevant source:

if (d > 1e+38) r = SLEEF_INFINITYf;

if (d > 1e+307) r = SLEEF_INFINITY;