Translating Maxima functions.



All necessary stuff can be found in
https://sites.google.com/site/pjpapasot/maxima/temporary

The code in question is the function "rkf45" and its translated version,
"rkf45_translated". These are basically the same. The only difference is
that in rkf45_translated the first argument is passed as a function created
by the user in main program, while in the non-translated code, rkf45, the
function is created dynamically. I needed to change this in order to be able
to translate the code (discussion about this a previous thread.)

To test the codes, run the "driver" program Test.mac, which solves a stiff
problem (so that it takes more time than usual and the difference in time
execution is more pronounced.) In my system (Quad Core processor @ 4 x 3
GHz, 4Mb RAM, running Debian GNU/LInux, 64 bit version), solving the problem
using non-translated code rkf45 takes about 31 seconds, while translated
code needs about 32.5 seconds. I can only think of two reasons causing that:
either mode_declaring floats as "any" doesn't help at all, or function
odes(x,y), which is called six times in every iteration, takes much more
time to be evaluated than the corresponding local function in rkf45, named
f_rhs, which is created dynamically.
Note that the block of variables [atol,xi,...x_tiny] should be declared as
"float", but if I try that, the translated code doesn't run at all.
Moreover, the block [maxit,bad_steps] should be declared as integer, but it
is not clear in the documentation how I can do that (I suspect they should
be declared as "number", but this is undocumented, as far I can tell.)

Also note that the code might need some polishing and fine-tuning before
final release.


> 2011/10/15 Robert Dodier <robert.dodier at gmail.com>
>
>> Can you post the code in question? I think that would clarify the
>> discussion.
>>
>> best
>>
>> Robert Dodier
>>
>
>