Comment #41 on issue 3006 by [email protected]: Inaccurate sin/cos values
http://code.google.com/p/v8/issues/detail?id=3006
I've confirmed that the bugs in D3 are related at least in part to the
behavior of sin(x) for small negative values. In particular, not only does
sin(x) != x for these values, but the new implementation is not symmetric
around zero. So, sin(x) != -sin(-x). For example:
sin( 0.000006981317007977318) = 0.000006981317007920608
sin(-0.000006981317007977318) = -0.000006981317007953942
In Safari, it is also true that sin(x) != x, but at least sin(x) ==
-sin(-x) (again, for small values):
sin( 0.000006981317007977318) = 0.000006981317007920608
sin(-0.000006981317007977318) = -0.000006981317007920608
This inconsistency means that degenerate spherical polygons (e.g., ABA) no
longer have spherical area 0 in Chrome, because the behavior of the points
AB and BA no longer cancel each other out due to the asymmetry, even when
using a double-precision adder [1].
Now I could patch the implementation of sin to special-case these values,
but I expect that would more than wipe out whatever performance gains the
new implementation offered.
[1] https://github.com/mbostock/d3/blob/master/src/math/adder.js
--
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.