Julian Squires <tek@...> writes:
> Well, I'm running Linux, not Darwin, but I'm looking at the same
> problems. I think you'll find aside from irrat.pure.lisp,
> bit-vector.impure-cload.lisp will also fail (somewhat spectacularly).
> I gather it's just running out of heap.
That's right, yes. bit-vector.impure-cload.lisp attempts to allocate
two bit-vectors of size (1- array-total-size-limit), because there was
an off-by-n error at one point in bit-vector transforms at the upper
limit. This fails spectacularly, as you say, on platforms whose
configuration doesn't allow that much heap.
There are probably free spaces for the heap which would allow larger
contiguous regions. If you find that you are running out of heap in a
real-world context, rather than just these tests, shout!
> I get the above (-4.8985) value or so from calling sin in C, on an
> OpenBSD/sparc64 system, on a Linux/ARM system, and on a Linux/PPC
> system. I get the test value (-4.8984) from running the same C program
> on a Linux/x86 system.
The problem (well, "problem") is in fact an artifact of a conforming
but eccentric implementation of IEEE floating point arithmetic by the
x86 hardware designers. This also shows up in that, on the x86,
sbcl's values for fooble-float-epsilon are wrong.
> Given this, I conditionalized the failing cases (all basically the same
> problem) by whether we're on x86 or not (see attached patch). I realize
> that this is not a cure-all solution, but it seems better than ``don't
> bother too much with the tests''. Of course, I don't really know what
> I'm doing.
I confess, I got sufficiently annoyed with irrat.pure.lisp that I
summarily deleted it. It needs replacing, of course, but probably
with a better-justified test than string-equality under printing.
A place to start is with the netlib IEEE conformance vectors: there
are vectors of bit-patterns expected from various floating point
operations on given arguments. They're not perfectly applicable,
because in some places IEEE wants NaNs where Lisp wants complex
numbers, but they're a start. I have the beginnings of a generated
suite from those vectors, but I need to work on it some more. Other
useful tests might include checking that results end up in the
expected quadrant of the complex plane (complicated by the
interpretation of 1-z^2 for FLOAT z).
http://www-jcsu.jesus.cam.ac.uk/~csr21/ +44 1223 510 299/+44 7729 383 757
(set-pprint-dispatch 'number (lambda (s o) (declare (special b)) (format s b)))
(defvar b "~&Just another Lisp hacker~%") (pprint #36rJesusCollegeCambridge)