Efficient Lisp functions -- using results of symbolic calculations numerically



On 9/7/07, Raymond Toy (RT/EUS) <raymond.toy at ericsson.com> wrote:

> > #<FUNCTION $H ($X) (DECLARE (IN-DEFUN $H) (SPECIAL $X) (FLONUM $X))
> >   (BLOCK $H
> >    (PROGN NIL (+ (* 2.0 (COS (EXPT$ $X 2))) (- (* (EXPT$ $X -2) (SIN
> > (EXPT$ $X 2)))))))>

> It would probably help a bit more if Lisp actually knew what a flonum
> type was. :-)  When I compile this with cmucl, it complains that flonum
> is an unknown type.  We probably need to add (deftype flonum ()
> 'double-float) somewhere.

Heh. Who knows, we could even change the translator to
emit (DECLARE (DOUBLE-FLOAT ...)) or whatever ...

Robert