Bug 15429 - ldbl-128 cos() inaccurate new pi/2
Summary: ldbl-128 cos() inaccurate new pi/2
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: math (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-02 20:34 UTC by David S. Miller
Modified: 2014-06-13 18:08 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 David S. Miller 2013-05-02 20:34:51 UTC
On sparc, which uses ldbl-128, the tests using cos() on pi/2 give
inaccurate results.  For example:

Test "cos (pi/2) == 0x1.cd129024e088a67cc74020bbea64p-115":
ildouble: 267676
ldouble: 267676
...
Test "sincos (pi/2, &sin_res, &cos_res) puts 0x1.cd129024e088a67cc74020bbea64p-115 in cos_res":
ildouble: 267676
ldouble: 267676
...
Function "cos":
ildouble: 267676
ldouble: 267676
...
Function "sincos":
ildouble: 267676
ldouble: 267676
Comment 1 Carlos O'Donell 2013-05-09 13:14:50 UTC
I'll be disabling this test for ldbl-128 until we fix this.
Comment 2 Joseph Myers 2013-05-09 21:31:18 UTC
Fixed for 2.18 by:

commit d0213cd0b629cae95ed9607fcf26793a3a0d686c
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Thu May 9 21:28:54 2013 +0000

    Fix ldbl-128 cos range reduction near pi/2 (bug 15429).