[Maxima] Efficient Lisp functions -- using results of symbolic calculations numerically
macrakis at alum.mit.edu
Fri Aug 31 17:19:44 CDT 2007
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.
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
More information about the Maxima