]> sourceware.org Git - glibc.git/commit
Fix powf inaccuracy (bug 21112).
authorJoseph Myers <joseph@codesourcery.com>
Tue, 7 Feb 2017 17:15:47 +0000 (17:15 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Tue, 7 Feb 2017 17:15:47 +0000 (17:15 +0000)
commitedbbdb185518008439221ed9db296ab31039d076
tree4332e967234b3fca070f1f94d9d735fc3cfffb11
parent43ce02c6ec27d4e2d8f0ae327bbbeaba84060964
Fix powf inaccuracy (bug 21112).

Bug 21112 reports a case where powf is substantially inaccurate.  This
results from a multiplication where cp_h*p_h is required to be exact,
and p_h is masked to have only 12 leading nonzero bits in its
mantissa, but the value of cp_h has the 13th bit nonzero, leading to
inexact multiplication results in some cases that can result in large
errors in the final result of powf.  This patch fixes this by using a
value of cp_h correctly rounded to nearest to 12 bits, with a
corresponding updated value of cp_l.

Tested for x86_64 and x86.

[BZ #21112]
* sysdeps/ieee754/flt-32/e_powf.c (cp_h): Use value with trailing
12 bits zero.
(cp_l): Update for new value of cp_h.
* math/auto-libm-test-in: Add another test of pow.
* math/auto-libm-test-out-pow: Regenerated.
ChangeLog
math/auto-libm-test-in
math/auto-libm-test-out-pow
sysdeps/ieee754/flt-32/e_powf.c
This page took 0.041653 seconds and 5 git commands to generate.