Details
-
Blog - New Blog Request
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
Jul-2015
Description
it so happens that in java, if x is of double type, Math.pow(x,2.0) and x * x produce different values approximately once in million random values.
This is extremely annoying as it creates rounding errors, especially with things like euclidean distance computations, which eventually may produce occasional NaNs.
This issue suggests to get special treatment on vector and matrix dsl to make sure identical fpu algorithms are running as follows:
x ^ 2 <=> x * x
x ^ 0.5 <=> sqrt