Comment #3 on issue 3035 by [email protected]: Math.sin(Math.PI)
inaccurate
http://code.google.com/p/v8/issues/detail?id=3035
OK, maybe I wasn't clear.
My first statement commented on the fact that the new result is much closer
to what you stated to be the correct answer. Given this, I don't understand
why you filed a bug.
In my second statement, I noted that my belief as to what the answer should
be is different from yours. I'd like to emphasize that I'm not implying
that either of us is right or wrong: I understand your reasoning, but I
reason differently.
In my third statement, I tried to reconcile these different beliefs by
pointing out that limited-precision arithmetic always has rounding errors.
Also, just because x is the best someone can reasonably hope for in a given
situation doesn't mean it's impossible to say that x+2 would be better than
x+1.
The reason why I said that "abs(expected-actual) <= 1e-15 is the best you
can hope for" is: 64-bit floating-point numbers have 15 to 16 decimal
digits of precision. When the first 15 digits are correct, that's
the "perfect" outcome. For values in the [-1,1] range, 15 correct digits
obviously means an absolute error of <= 1e-15.
The reason why an "inaccurate" value can be WAI is: All floating-point
arithmetic is inaccurate, yet it is very much working as intended. In
practical applications, we have neither infinite memory for storing values,
nor infinite time for computing them. Well-designed algorithms don't care
much; most applications even prefer the slightly faster speed of 32-bit
floats over the better precision of 64-bit computations.
You don't need trigonometric functions to trigger "obviously wrong"
behavior: 0.1*0.1*100 == 1.0000000000000002. This, too, is working as
intended.
--
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.