]> git.ipfire.org Git - thirdparty/glibc.git/commit
Fix cos computation for multiple precision fallback (bz #20357)
authorSiddhesh Poyarekar <siddhesh@sourceware.org>
Mon, 18 Jul 2016 17:03:09 +0000 (22:33 +0530)
committerFlorian Weimer <fweimer@redhat.com>
Wed, 2 Nov 2016 08:10:28 +0000 (09:10 +0100)
commit422facff9f2c4972e2dc46090a704d11b840b0c0
tree89f458f6cba4e6b9336480f520b93aa12d058831
parent6ab1e91474c0faab25a568436b846c2630624039
Fix cos computation for multiple precision fallback (bz #20357)

During the sincos consolidation I made two mistakes, one was a logical
error due to which cos(0x1.8475e5afd4481p+0) returned
sin(0x1.8475e5afd4481p+0) instead.

The second issue was an error in negating inputs for the correct
quadrants for sine.  I could not find a suitable test case for this
despite running a program to search for such an input for a couple of
hours.

Following patch fixes both issues.  Tested on x86_64.  Thanks to Matt
Clay for identifying the issue.

[BZ #20357]
* sysdeps/ieee754/dbl-64/s_sin.c (sloww): Fix up condition
to call __mpsin/__mpcos and to negate values.
* math/auto-libm-test-in: Add test.
* math/auto-libm-test-out: Regenerate.

(cherry picked from commit cbf88869edced4b23d792d95a8626e35b831df35)
ChangeLog
NEWS
math/auto-libm-test-in
math/auto-libm-test-out
sysdeps/ieee754/dbl-64/s_sin.c