Improve the test float.impure.lisp / (RANGE-REDUCTION PRECISE-PI).
authorLutz Euler <lutz.euler@freenet.de>
Wed, 28 Aug 2013 21:09:05 +0000 (23:09 +0200)
committerLutz Euler <lutz.euler@freenet.de>
Wed, 28 Aug 2013 21:09:05 +0000 (23:09 +0200)
commit69a917778bad1b3c82a8cdd511097adf11a1531a
tree7f5c867e9b0d93ddd2b2a951d27dee2e2f28cb34
parentadaba39fb52f52487bd1a1b632b735e59045e19d
Improve the test float.impure.lisp / (RANGE-REDUCTION PRECISE-PI).

The way the test calculated its expected values was flawed and worked
correctly only accidentally due to the specific test values used and
to allowing a relatively large margin of error.

This commit corrects these calculations, removes some test values and
adds others and tightens the error margin. I do not expect this to cause
the test's outcome on any platform to change.

The flaw was to reduce the arguments by taking the remainder of
truncating modulo 2 pi. This allows precise calculations only of the
sine and the tangent of values slightly above even multiples of pi, but
not for example for the sine of an argument near an odd multiple of pi.
Instead the reduction is now done by taking the remainder of rounding
to the nearest multiple of pi/2 so that all arguments near the zeroes
of both sine and cosine reduce to values near zero.

This change was prompted when the test unexpectedly failed with some
values from gcc bug 43490 which I tried when investigating lp #1137924.
tests/float.impure.lisp