diff options
author | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2018-06-14 10:54:06 +0100 |
---|---|---|
committer | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2018-06-15 08:59:53 +0100 |
commit | 2117b83270c9cab565e479d0ab433c428a72b16a (patch) | |
tree | 9029b341bdc898e5a28a7f389239a46b089e6c83 /math/exp_data.c | |
parent | f6717402b7f0d70726ef421cbbce2fa1fa913794 (diff) | |
download | arm-optimized-routines-2117b83270c9cab565e479d0ab433c428a72b16a.tar.gz |
Fix spurious underflow in exp without fma
The last multiplication in exp and exp2 could underflow when it was not
contracted into an fma. Changed the thresholds so the problematic cases
end up in the specialcase code path (which handles underflow correctly).
The initial check now only looks at the exponent bits which has slightly
better performance on aarch64. The overflow threshold can be tight for
exp2, but was let loose in exp so the specialcase handling got updated
accordingly.
Added comments about this issue and the assumptions exp_inline is making
in pow.
Diffstat (limited to 'math/exp_data.c')
-rw-r--r-- | math/exp_data.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/math/exp_data.c b/math/exp_data.c index adfca9d..2961a94 100644 --- a/math/exp_data.c +++ b/math/exp_data.c @@ -67,6 +67,7 @@ const struct exp_data __exp_data = { // abs error: 1.555*2^-66 // ulp error: 0.509 (0.511 without fma) // if |x| < ln2/256+eps +// abs error if |x| < ln2/256+0x1p-15: 1.09*2^-65 // abs error if |x| < ln2/128: 1.7145*2^-56 0x1.ffffffffffdbdp-2, 0x1.555555555543cp-3, |