This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: incorrect result from cos on non-x86 platform
- From: Segher Boessenkool <segher at koffie dot nl>
- To: Philip Blundell <philb at gnu dot org>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Mon, 20 Jan 2003 05:50:30 +0100
- Subject: Re: incorrect result from cos on non-x86 platform
- References: <1042673280.28313.40.camel@kc.cam.armlinux.org>
I'll just say: wow.
Please apply.
2003-01-20 Segher Boessenkool <segher@koffie.nl>
* sysdeps/ieee754/dbl-64/sincos32.c (__mpcos): Really
compute the cosine, not the sine, even if x > 0.8.
*** sysdeps/ieee754/dbl-64/sincos32.c.orig Mon Jan 20 05:17:54 2003
--- sysdeps/ieee754/dbl-64/sincos32.c Mon Jan 20 05:18:10 2003
*************** double __mpcos(double x, double dx) {
*** 214,220 ****
__add(&a,&b,&c,p);
if (x>0.8)
{ __sub(&hp,&c,&b,p);
! __c32(&b,&a,&c,p);
}
else __c32(&c,&a,&b,p); /* a = cos(x+dx) */
__mp_dbl(&a,&y,p);
--- 214,220 ----
__add(&a,&b,&c,p);
if (x>0.8)
{ __sub(&hp,&c,&b,p);
! __c32(&b,&c,&a,p);
}
else __c32(&c,&a,&b,p); /* a = cos(x+dx) */
__mp_dbl(&a,&y,p);