Re: 1.5.24: sin() bug

2007-08-30 Thread Lev Bishop
On 8/29/07, Dmitry Karasik wrote: > I'd like to submit a bug in cygwin implementation of sin(). > the difference is in 7th digit, and is significant for double precision. This is not a bug in newlib. The problem is in glibc and msvc and newlib is (more) correct in this case. Or, to put it anothe

RE: 1.5.24: sin() bug

2007-08-29 Thread Dave Korn
On 29 August 2007 18:31, Brian Dessent wrote: > Dave Korn wrote: > >> Since when was pi less than 2^-27? > > This is a kernel sin, a function over the limited range [-pi/4, pi/4], > where the general case sin is reduced to kernel sin by the remainder of > modulus pi/2. Ah, I see. >> I t

Re: 1.5.24: sin() bug

2007-08-29 Thread Brian Dessent
Brian Dessent wrote: > > Since when was pi less than 2^-27? > > This is a kernel sin, a function over the limited range [-pi/4, pi/4], > where the general case sin is reduced to kernel sin by the remainder of > modulus pi/2. And note that the testcase is not exactly pi, it's pi minus a very sm

Re: 1.5.24: sin() bug

2007-08-29 Thread Brian Dessent
Dave Korn wrote: > Since when was pi less than 2^-27? This is a kernel sin, a function over the limited range [-pi/4, pi/4], where the general case sin is reduced to kernel sin by the remainder of modulus pi/2. > I think it may be an artefact of FP precision and/or rounding mode, but I'd > n

RE: 1.5.24: sin() bug

2007-08-29 Thread Dave Korn
On 29 August 2007 18:07, Brian Dessent wrote: > Dmitry Karasik wrote: > >> #include >> #include >> int main( int argc, char ** argv) >> { >> double g = (double) 3.1415926535897900074; >> printf("sin(%.10g)=%.10g\n", g, sin(g)); >> } >> >> output is : >> >> sin(3.141592654)=3.2

Re: 1.5.24: sin() bug

2007-08-29 Thread Brian Dessent
Dmitry Karasik wrote: > #include > #include > int main( int argc, char ** argv) > { > double g = (double) 3.1415926535897900074; > printf("sin(%.10g)=%.10g\n", g, sin(g)); > } > > output is : > > sin(3.141592654)=3.231089149e-15 > > whereas all other sin() implementation I cou

1.5.24: sin() bug

2007-08-29 Thread Dmitry Karasik
Hello, I'd like to submit a bug in cygwin implementation of sin(). The following simple program demonstrates this: #include #include int main( int argc, char ** argv) { double g = (double) 3.1415926535897900074; printf("sin(%.10g)=%.10g\n", g, sin(g)); } output is : sin(3.141