Comment #12 on issue 3006 by [email protected]: Inaccurate sin/cos values
http://code.google.com/p/v8/issues/detail?id=3006

I respectfully disagree. As the person making the change, the burden is on you to demonstrate that the max relative error over a reasonably large range is not significantly worse than the existing implementation. It may be accurate enough for you (and that's fine), but there are millions of applications out there and you can't arbitrarily change their results because you've reduced the accuracy of the trig functions.

I 'm not asking you to mimic one approx with another. I would like accurate values for sin and cos.

cos(2^120) does not need to be 0.477, because, well the correct answer is -0.92. I concede that this is a corner case that requires accurate pi reduction. This is a quality of implementation issue. But there are differences for values as small as 2200*pi. The value of Math.tan(Math.PI/2) is incorrect. Since tan(x) is +infinity from the left and -infinity from the right, I don't see returning +Infinity is correct either.

I do not see the ECMAscript spec very vague. It explicitly gives some leeway, but the intent in 15.8.2 is clear when it says that the same library can be used that is available to the C programmer. It also recommended using the same algorithms as given in Sun's fdlibm. A library written by an expert in the field. I'm pretty sure this library says cos(2^120) = -0.92.

I would love to have something twice as fast, but it needs to be accurate too.

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to