------- Comment #5 from simon dot fenney at imgtec dot com 2010-03-23 13:10 ------- (In reply to comment #4) > > BUT sin(x) becomes progressively more inaccurate with increasing magnitude > > of > > x, as with the above version (on x86). At a guess, it would seem like > > something > > has broken the "range reduction" maths. > > Since pi is irrational, "range reduction" is inherently "broken" for large x. > Try to compute sin(x) for a large value of x and its nearest values from below > and above.
Yes, I am aware of that, but the *standard* seems to be to assume that the source value is accurate, compute the range reduced result to sufficient precision, and then compute sine/cosine to the required ULP accuracy. (e.g. see Payne-Hanek reduction algorithm or any of the newer methods such as ftp://ftp.inria.fr/INRIA/publication/dienst/RR-4267.pdf). It was working on earlier incarnations so is frustrating that it's now broken. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43490