This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: weird optimization in sin+cos, x86 backend
On 02/10/2012 05:31 PM, PaweÅ Sikora wrote:
> it would be also nice to see functions for reducing argument range in public api.
> finally the end-user can use e.g. sin(reduce(x)) to get the best precision
> with some declared cpu overhead.
Hmm. I'm not sure this is such a terrific idea: each function has its
own argument reduction (e.g. to [0, pi/4], [0, pi/8] or even [0, some
weird constant that looks arbitrary but just happens to be exactly
representable in binary]). You really don't want double rounding,
which is what would happen with sin(reduce(x)).
Andrew.