On 1/10/2013 8:16 AM, Leo Butler wrote:
> I'm interested in writing some code that takes a Maxima expression and
> compiles it into a function. The application that I have in mind is to
> write numerical integrators for systems of odes.
>
> What I have done is simple(-minded): I extract the listofvars from the
> expression, subst gensyms in place, create a function which
> mode_declares the variables to be flonums and then compile that
> function using the Maxima compile command.
>
> I wonder if someone has suggestions on how to improve this,
> speed-wise. The expressions in question involve the 'elementary'
> functions and their compositions, say.
>
> Leo
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
There's stuff around like "GENTRAN" with a related goal,
but to generate Fortran subroutines that you take out of Maxima and
put in somewhere else.
What you are doing sounds reasonable, though.
You might find using buildq useful.
RJF