diff options
author | Siddhesh Poyarekar <siddhesh@redhat.com> | 2014-02-27 21:12:09 +0530 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@redhat.com> | 2014-02-27 21:12:09 +0530 |
commit | 1cadc85813d736f7682fa2eeadae639ab6b66c65 (patch) | |
tree | 888639c3cafe46a0abd42bcae297056041577e8e /sysdeps | |
parent | f8c17e79fab13a3d1de976c1c3564df7f8c2a175 (diff) | |
download | glibc-1cadc85813d736f7682fa2eeadae639ab6b66c65.tar glibc-1cadc85813d736f7682fa2eeadae639ab6b66c65.tar.gz glibc-1cadc85813d736f7682fa2eeadae639ab6b66c65.tar.bz2 glibc-1cadc85813d736f7682fa2eeadae639ab6b66c65.zip |
Fix sign of input to bsloww1 (BZ #16623)
In 84ba214c, I removed some redundant sign computations and in the
process, I incorrectly got rid of a temporary variable, thus passing
the absolute value of the input to bsloww1. This caused #16623.
This fix undoes the incorrect change.
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/ieee754/dbl-64/s_sin.c | 16 | ||||
-rw-r--r-- | sysdeps/x86_64/fpu/libm-test-ulps | 44 |
2 files changed, 54 insertions, 6 deletions
diff --git a/sysdeps/ieee754/dbl-64/s_sin.c b/sysdeps/ieee754/dbl-64/s_sin.c index 6105e9fbdf..50109b8dd4 100644 --- a/sysdeps/ieee754/dbl-64/s_sin.c +++ b/sysdeps/ieee754/dbl-64/s_sin.c @@ -447,19 +447,21 @@ __sin (double x) } else { + double t; if (a > 0) { m = 1; + t = a; db = da; } else { m = 0; - a = -a; + t = -a; db = -da; } - u.x = big + a; - y = a - (u.x - big); + u.x = big + t; + y = t - (u.x - big); res = do_sin (u, y, db, &cor); cor = (cor > 0) ? 1.035 * cor + eps : 1.035 * cor - eps; retval = ((res == res + cor) ? ((m) ? res : -res) @@ -671,19 +673,21 @@ __cos (double x) } else { + double t; if (a > 0) { m = 1; + t = a; db = da; } else { m = 0; - a = -a; + t = -a; db = -da; } - u.x = big + a; - y = a - (u.x - big); + u.x = big + t; + y = t - (u.x - big); res = do_sin (u, y, db, &cor); cor = (cor > 0) ? 1.035 * cor + eps : 1.035 * cor - eps; retval = ((res == res + cor) ? ((m) ? res : -res) diff --git a/sysdeps/x86_64/fpu/libm-test-ulps b/sysdeps/x86_64/fpu/libm-test-ulps index f3980f8221..544f1c7189 100644 --- a/sysdeps/x86_64/fpu/libm-test-ulps +++ b/sysdeps/x86_64/fpu/libm-test-ulps @@ -10900,6 +10900,14 @@ idouble: 1 Test "cos_downward (0x1.0c152382d7365p+0)": double: 1 idouble: 1 +Test "cos_downward (0x1.200145a975ce6p+32)": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "cos_downward (0x1.200146p+32)": +ildouble: 1 +ldouble: 1 Test "cos_downward (0x1.921fb4p+0)": ildouble: 1 ldouble: 1 @@ -11126,6 +11134,9 @@ idouble: 1 Test "cos_towardzero (0x1.0c152382d7365p+0)": double: 1 idouble: 1 +Test "cos_towardzero (0x1.200146p+32)": +double: 1 +idouble: 1 Test "cos_towardzero (0x1.921fb4p+0)": ildouble: 1 ldouble: 1 @@ -11258,6 +11269,17 @@ idouble: 1 Test "cos_upward (0x1.0c1524p+0)": double: 1 idouble: 1 +Test "cos_upward (0x1.200144p+32)": +double: 1 +idouble: 1 +Test "cos_upward (0x1.200145a975ce6p+32)": +ildouble: 1 +ldouble: 1 +Test "cos_upward (0x1.200146p+32)": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 Test "cos_upward (0x1.921fb4p+0)": double: 1 idouble: 1 @@ -15155,6 +15177,19 @@ double: 1 idouble: 1 ildouble: 1 ldouble: 1 +Test "sin_downward (0x1.2001469775ce6p+32)": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "sin_downward (0x1.200146p+32)": +double: 1 +idouble: 1 +Test "sin_downward (0x1.200148p+32)": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 Test "sin_downward (0x1.921fb54442d18468p+0)": ildouble: 1 ldouble: 1 @@ -15383,6 +15418,9 @@ double: 1 idouble: 1 ildouble: 1 ldouble: 1 +Test "sin_towardzero (0x1.200146p+32)": +double: 1 +idouble: 1 Test "sin_towardzero (0x1.921fb54442d18468p+0)": ildouble: 1 ldouble: 1 @@ -15532,6 +15570,12 @@ ldouble: 1 Test "sin_upward (-0x8.60a92p-4)": ildouble: 1 ldouble: 1 +Test "sin_upward (0x1.2001469775ce6p+32)": +ildouble: 1 +ldouble: 1 +Test "sin_upward (0x1.200148p+32)": +ildouble: 1 +ldouble: 1 Test "sin_upward (0x1.921fb4p+0)": double: 1 idouble: 1 |