summaryrefslogtreecommitdiff
path: root/math/auto-libm-test-out-pow
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2017-02-07 17:15:47 +0000
committerJoseph Myers <joseph@codesourcery.com>2017-02-07 17:15:47 +0000
commitedbbdb185518008439221ed9db296ab31039d076 (patch)
tree4332e967234b3fca070f1f94d9d735fc3cfffb11 /math/auto-libm-test-out-pow
parent43ce02c6ec27d4e2d8f0ae327bbbeaba84060964 (diff)
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.
Diffstat (limited to 'math/auto-libm-test-out-pow')
-rw-r--r--math/auto-libm-test-out-pow25
1 files changed, 25 insertions, 0 deletions
diff --git a/math/auto-libm-test-out-pow b/math/auto-libm-test-out-pow
index d2c662eec2..4a9f1fc66a 100644
--- a/math/auto-libm-test-out-pow
+++ b/math/auto-libm-test-out-pow
@@ -44146,3 +44146,28 @@ pow 0xd.73035p-4 -0x1.47bb8p+8
= pow tonearest ibm128 0xd.73035p-4 -0x1.47bb8p+8 : 0x4.523987c590d3192757b32fb92cp+80 : inexact-ok
= pow towardzero ibm128 0xd.73035p-4 -0x1.47bb8p+8 : 0x4.523987c590d3192757b32fb92cp+80 : inexact-ok
= pow upward ibm128 0xd.73035p-4 -0x1.47bb8p+8 : 0x4.523987c590d3192757b32fb92ep+80 : inexact-ok
+pow 0x1.059c76p+0 0x1.ff80bep+11
+= pow downward binary32 0x1.059c76p+0 0xf.fc05fp+8 : 0xf.ffe55p+124 : inexact-ok
+= pow tonearest binary32 0x1.059c76p+0 0xf.fc05fp+8 : 0xf.ffe55p+124 : inexact-ok
+= pow towardzero binary32 0x1.059c76p+0 0xf.fc05fp+8 : 0xf.ffe55p+124 : inexact-ok
+= pow upward binary32 0x1.059c76p+0 0xf.fc05fp+8 : 0xf.ffe56p+124 : inexact-ok
+= pow downward binary64 0x1.059c76p+0 0xf.fc05fp+8 : 0xf.ffe5535a38f98p+124 : inexact-ok
+= pow tonearest binary64 0x1.059c76p+0 0xf.fc05fp+8 : 0xf.ffe5535a38f98p+124 : inexact-ok
+= pow towardzero binary64 0x1.059c76p+0 0xf.fc05fp+8 : 0xf.ffe5535a38f98p+124 : inexact-ok
+= pow upward binary64 0x1.059c76p+0 0xf.fc05fp+8 : 0xf.ffe5535a38fap+124 : inexact-ok
+= pow downward intel96 0x1.059c76p+0 0xf.fc05fp+8 : 0xf.ffe5535a38f9be6p+124 : inexact-ok
+= pow tonearest intel96 0x1.059c76p+0 0xf.fc05fp+8 : 0xf.ffe5535a38f9be6p+124 : inexact-ok
+= pow towardzero intel96 0x1.059c76p+0 0xf.fc05fp+8 : 0xf.ffe5535a38f9be6p+124 : inexact-ok
+= pow upward intel96 0x1.059c76p+0 0xf.fc05fp+8 : 0xf.ffe5535a38f9be7p+124 : inexact-ok
+= pow downward m68k96 0x1.059c76p+0 0xf.fc05fp+8 : 0xf.ffe5535a38f9be6p+124 : inexact-ok
+= pow tonearest m68k96 0x1.059c76p+0 0xf.fc05fp+8 : 0xf.ffe5535a38f9be6p+124 : inexact-ok
+= pow towardzero m68k96 0x1.059c76p+0 0xf.fc05fp+8 : 0xf.ffe5535a38f9be6p+124 : inexact-ok
+= pow upward m68k96 0x1.059c76p+0 0xf.fc05fp+8 : 0xf.ffe5535a38f9be7p+124 : inexact-ok
+= pow downward binary128 0x1.059c76p+0 0xf.fc05fp+8 : 0xf.ffe5535a38f9be648255c105d56p+124 : inexact-ok
+= pow tonearest binary128 0x1.059c76p+0 0xf.fc05fp+8 : 0xf.ffe5535a38f9be648255c105d568p+124 : inexact-ok
+= pow towardzero binary128 0x1.059c76p+0 0xf.fc05fp+8 : 0xf.ffe5535a38f9be648255c105d56p+124 : inexact-ok
+= pow upward binary128 0x1.059c76p+0 0xf.fc05fp+8 : 0xf.ffe5535a38f9be648255c105d568p+124 : inexact-ok
+= pow downward ibm128 0x1.059c76p+0 0xf.fc05fp+8 : 0xf.ffe5535a38f9be648255c105d4p+124 : inexact-ok
+= pow tonearest ibm128 0x1.059c76p+0 0xf.fc05fp+8 : 0xf.ffe5535a38f9be648255c105d4p+124 : inexact-ok
+= pow towardzero ibm128 0x1.059c76p+0 0xf.fc05fp+8 : 0xf.ffe5535a38f9be648255c105d4p+124 : inexact-ok
+= pow upward ibm128 0x1.059c76p+0 0xf.fc05fp+8 : 0xf.ffe5535a38f9be648255c105d8p+124 : inexact-ok