bug in ACOS, etc.

Gary Byers <[email protected]> Tue, 10 Dec 2002 08:58:20 -0700 (MST)
Newsgroups gmane.lisp.openmcl.bugs
Message-ID <[email protected]>
ACOS (and ASIN, and I'm not sure what else) when applied to arguments
that are or are promoted to SINGLE-FLOAT and are outside the range
((-1.0) (1.0)) produce a complex result that:

a) is of type (COMPLEX DOUBLE-FLOAT) instead of (COMPLEX SINGLE-FLOAT)
b) has the wrong real part.

The culprit seems to be CCL::%SF-ATAN2, which says (in part):

  (float-sign y half-pi)

HALF-PI is a constant of type DOUBLE-FLOAT, so that call wants to
be something equivalent to:

  (float-sign y (coerce half-pi 'single-float))


There are some other cases in that file ("ccl:level-0;l0-float.lisp")
where a similar coercion happens at runtime; it would probably make
more sense to define SINGLE-HALF-PI where HALF-PI is defined and
use that constant where appropriate.