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]

Re: Alternative math libraries




> >> I was sure that linux glibc libm on Intel uses the actual x86
> >> trigometric instructions to implement these routines.
> >> 
> >> Later,
> >> David S. Miller
> >> davem@redhat.com
> >
> >That's correct.  Those hardware instructions only give the correct
> >answer when |x|<2^62.
> 
> No, that's not right.  More marketing doubletalk.  It's worse than
> that.  The incorrect answer threshold, for absolute measure, is about 2^18
> for double precision and 2^47 for single precision.  2^62 is the
> *totally* wrong answer threshold, where the error approaches 100%
> and the hardware raises a flag.

This is pretty awful.

The thing that I find confusing is that libm already contains
high-quality, tested argument reduction code.   Isn't it straightforward
to make the trig functions call this routine when |x|>2^18 for double
precision or |x|>2^47 for single precision?

Or are there technical issues that I am unaware of?

Bruce


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