4 Feb 2004 21:55
SIN on Darwin
Pascal J. Bourguignon <pjb <at> informatimago.com>
2004-02-04 20:55:25 GMT
2004-02-04 20:55:25 GMT
I've just compiled sbcl 0.8.7 on Darwin naiad.informatimago.com 6.8
Darwin Kernel Version 6.8: Wed Sep 10 15:20:55 PDT 2003;
root:xnu/xnu-344.49.obj~2/RELEASE_PPC Power Macintosh powerpc, which
went well.
In irrat.pure.lisp, the tests fail on (SIN (* 8 (/ PI 2)))
which returns: -4.898425415289509d-16 on Linux/ix86
but returns: -4.898587196588413d-16 on Darwin/ppc750.
which is wrong in both cases: sin(8pi/2)=sin(4pi)=sin(2*2pi)=sin(0)=0.
So I guess it does not matter that the eleventh significant digit
differ if the first is wrong!
Instead of testing against a string representation of the computed
value, it would be much better to test sanely for a floating point
number:
(assert (and (< (abs (sin (* 8 (/ pi 2)))) 1d15)
(equal (print1-to-string -4.898425415289509d-16)
"-4.898425415289509d-16")))
instead of:
(assert (equal (print1-to-string (sin (* 8 (/pi 2)))) "-4.89whateverD-16"))
And similarly for some other tests involving floating point or complex
floating point numbers...
(Continue reading)
RSS Feed