diff options
author | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2020-11-13 17:09:00 +0000 |
---|---|---|
committer | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2020-11-13 17:22:21 +0000 |
commit | 94b4be6009322a584cd3f7b74f22565a162bddfa (patch) | |
tree | 649d783fee95bcb7ed810a0b5689a933ad1ff8e9 /math/erf.c | |
parent | 15a1d62bf0d6e6069a917b633b5013e36f08e017 (diff) | |
download | arm-optimized-routines-94b4be6009322a584cd3f7b74f22565a162bddfa.tar.gz |
math: fix spurious underflow in erff and erf
The code relied on the final x + c*x to be done via an fma, otherwise
the intermediate c*x could underflow for tiny (almost subnormal) x.
Use explicit fmaf like elsewhere (this code is not expected to be
fast when fma is not inlined, but at least it should be correct).
Diffstat (limited to 'math/erf.c')
-rw-r--r-- | math/erf.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -47,7 +47,7 @@ erf (double x) { /* a < 2^(-28). */ if (ia < 0x00800000) { /* a < 2^(-1015). */ - double y = x + TwoOverSqrtPiMinusOne * x; + double y = fma (TwoOverSqrtPiMinusOne, x, x); return check_uflow (y); } return x + TwoOverSqrtPiMinusOne * x; |