When executing
f(k):=integrate(exp(%i*k*x)*sin(x)/x,x,minf,inf)$
plot2d(f,[x,-3,3]);
The plot does not show anything in [-1;1].
The draw package has a similar problem. When the function returned by coerce-float-fun is applied to x values in the range [-1,1] to get the corresponding ordinate, it returns $%pi, instead of a float. An extra call to $float fixes this problem.
Raymond Toy
2009-11-02
Found the problem. It's in coerce-maxima-function-or-maxima-lambda. In this routine, the function does:
(if ($numberp result)
($float result)
result)))
But in this case, result is '$%pi, and ($numberp '$%pi) returns NIL. Perhaps this is a misunderstanding of what $numberp does, but I see no reason why we can't just get rid of the test and always call $float. With this fix, the graph is pi between -1 and 1.
Mario Rodriguez Riotorto
2009-11-02
Thanks for looking at this,
draw also works fine with this change.
I see the same piece of code in coerce-lisp-function-or-lisp-lambda, but I don't know of possible implications of changing this function too.
Raymond Toy
2009-11-03
Thanks for pointing out the second issue. Both of these are fixed in plot.lisp, rev 1.144.
Closing bug report.
Raymond Toy
2009-11-03