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

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



On Sun, Mar 21, 2010 at 04:30:36PM +0100, Vincent Lefevre wrote:
> On 2010-03-21 16:14:49 +0100, Aurelien Jarno wrote:
> > On Wed, Mar 17, 2010 at 11:29:00AM +0100, Vincent Lefevre wrote:
> > > 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!
> > 
> > Where did you get this result? In my tests both the x87 FPU and the
> > current glibc code give the following result when using double variables
> > and the sincos() function:
> > 
> > sin (1e22) =  0.46261304076460174617
> > cos (1e22) = -0.88656030506363692201
> 
> Actually the sincos() function uses the x87 FPU (fsincos instruction),
> so that's not surprising that you get the same result.
> 

That just means that the precision is not an argument for switching to
the x87 FPU version, contrary to what your first email suggested. Both
are wrong.

-- 
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net



Reply to: