[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#572746: libm: sinf/cosf performance is awful on amd64



On 17.03.2010 11:29, Vincent Lefevre wrote:
On 2010-03-07 16:17:08 +0100, Aurelien Jarno wrote:
On amd64, only sincos has an optimized version,

It may be optimized, but completely buggy. For instance, on 1e22,
sincos returns 0.46261304076460174617 for the sine instead of
-0.85220084976718879499 (correctly rounded value). Even the sign
is incorrect!

Sorry, but I don't see the error. Both are the correct values,
as any values from -1 to 1.

The double "1e22" is outside the *relevant* precision for double,
e.g. a whole range of 2*pi is described with the same number (1e22).

Maybe using long double (and sincosl) you will have the expected results (I did not calculate the minimun precision of long double).

ciao
	cate



Reply to: