Comment #2 on issue 1975 by [email protected]: Precision of trignometric
functions is low
http://code.google.com/p/v8/issues/detail?id=1975
test262/S15.8.2.18_A7 tests whether (within a certain tolerance)
tan(-1.57079632679489660000) == -16331239353195370.00000000000000000000
Note that this value is very close to Pi/2, around which tangens is an
unstable function. On IA32, both the FPU instruction and the library
function for tangent use 80-bit precision provided by the FPU, which
results in -16331778728383844, which is outside the tolerated range. This
can also be observed on 32-bit Firefox on Linux, which suffers from the
same problem and can be circumvented when compiling with -ffloat-store.
However, when calculating with an arbitrary-precision calculator such as bc
or Wolfram Alpha, the result is approximately -5.19985E16.
The spec (15.8.2.18) requires an implementation-dependent approximation.
This test should therefore not test a locally unstable function against the
result of any particular implementation, much less one that is not accurate
to begin with.
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev