Efficient Lisp functions -- using results of symbolic calculations numerically



With appropriate declarations, translate/compile will generate code
for float, integer, or symbolic calculations. If you mode_declare all
your variables as floats, it should calculate in float.

         -s


On 8/31/07, Bruno Daniel <bruno.daniel at gmx.net> wrote:
> > We do.  See the translate and compile commands.
>
> Thanks for your answer. I suppose the translate and compile commands are not
> quite the same, since they still work on expression datastructures and
> evaluate them, don't they? The lambda functions created by lambda-by-maxima,
> on the other hand, work purely numerically on double-floats and don't deal
> with symbolic expressions any more; they rather _are_ expressions:
>
> #'(LAMBDA (X)
>     (DECLARE (TYPE DOUBLE-FLOAT X) (VALUES DOUBLE-FLOAT)
>      (OPTIMIZE (SPEED 3) (SPACE 0) (SAFETY 0) (DEBUG 0)))
>     (+ (* 2 (COS (EXPT X 2))) (- (* (/ (EXPT X 2)) (SIN (EXPT X 2))))))
>
> Correct me if I'm wrong.
>
> Best regards
>   Bruno Daniel
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>