Bug 13837 - Trig functions experience catastrophic precision loss at large argument magnitudes
Summary: Trig functions experience catastrophic precision loss at large argument magni...
Status: RESOLVED DUPLICATE of bug 13658
Alias: None
Product: glibc
Classification: Unclassified
Component: math (show other bugs)
Version: unspecified
: P2 critical
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-13 03:21 UTC by Rich Felker
Modified: 2014-06-13 14:07 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rich Felker 2012-03-13 03:21:52 UTC
On x86, glibc's sin(0x1p1023) returns:
-0.633004553570852834809556952677667140960693359375

The correct value (rounded to double precision, within 1ulp) is:
0.563127779850884024881452205590903759002685546875

Or, rounded to the DBL_DIG digits (15):
0.563127779850884

In case there's any doubt as to the true value, it agrees with Wolfram Alpha's estimate of sin(2^1023), which is:
0.5631277798508840134529434079444683477103854907361251

Source:
http://www.wolframalpha.com/input/?i=sin%282%5E1023%29

Apparently glibc's trig functions are failing to perform argument reduction in any sane way...
Comment 1 Andreas Jaeger 2012-03-15 13:31:20 UTC
This is a duplicate of bug#13658. I'll add your test case to the testsuite.

*** This bug has been marked as a duplicate of bug 13658 ***