This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug math/20357] New: Incorrect cos result for 1.5174239687223976
- From: "siddhesh at sourceware dot org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Tue, 12 Jul 2016 08:45:06 +0000
- Subject: [Bug math/20357] New: Incorrect cos result for 1.5174239687223976
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=20357
Bug ID: 20357
Summary: Incorrect cos result for 1.5174239687223976
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: math
Assignee: unassigned at sourceware dot org
Reporter: siddhesh at sourceware dot org
Target Milestone: ---
cos(1.5174239687223976) incorrectly returns the sine instead of the cosine
value due to an incorrect check in sloww().
Reproduce:
#include <stdio.h>
#include <math.h>
int main()
{
double phi = 1.5174239687223976;
printf("Enter %0.17g\n", 1.5174239687223976);
scanf("%lf", &phi);
printf("%0.17g %0.17g %0.17g\n", phi, cos(phi), cos(1.5174239687223976));
return 0;
}
Actual Result:
Enter 1.5174239687223976
1.5174239687223976
1.5174239687223976 0.99857603377191229 0.053347022188279226
Expected Result:
Enter 1.5174239687223976
1.5174239687223976
1.5174239687223976 0.053347022188279226 0.053347022188279226
Fix coming up. Thanks to Matt Clay for identifying the issue.
--
You are receiving this mail because:
You are on the CC list for the bug.