Q: compiling causes problems in evaluating functions?
Subject: Q: compiling causes problems in evaluating functions?
From: Robert Gloeckner
Date: Mon, 23 Apr 2007 00:53:48 +0200
Hello,
I really hope this is my fault...
[maxima 5.9.10 on Linux]
my code:
--------------------------------
A_N:1e+21;
B_N:30;
T_C:264;
eq4_7_(T, _p) := (A_N / sqrt(2.0 * %pi * B_N * B_N)) *
exp(-0.5 * ((T - T_C) / B_N)^2 );
---------------------------------
(%i95) eq4_7_(T, _p) := (A_N / sqrt( 2.0 * %pi * B_N * B_N)) *
exp(-0.5 * ((T - T_C) / B_N)^2 );
A_N T - T_C 2
(%o95) eq4_7_(T, _p) := --------------------- exp((- 0.5) (-------) )
sqrt(2.0 %pi B_N B_N) B_N
(%i96) eq4_7_(xx,yy);
2
- 5.555555555555556E-4 (xx - 264)
2.357022603955158E+19 %e
(%o96) ----------------------------------------------------------
sqrt(%pi)
(%i97) compile(eq4_7_);
Compiling gazonk0.lsp.
End of Pass 1.
End of Pass 2.
OPTIMIZE levels: Safety=2, Space=3, Speed=2
Finished compiling gazonk0.lsp.
(%o97) [eq4_7_]
(%i98) eq4_7_(xx,yy);
(%o98)
2
- 5.555555555555556E-4 (xx - 2.121995921398603E-314)
2.357022603955158E+19 %e
-----------------------------------------------------------------------------
sqrt(%pi)
(%i99)
How can that be? I need to use compile, because otherwise evaluation
functions (numerical integration) take much too long. What is the
problem in this case?
Can somebody verify this behaviour?
If it is a bug - is this fixed in more recent versions of maxima?
Thanks
Robert