This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: incorrect result from cos on non-x86 platform


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);



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]