Share

Maxima -- GPL CAS based on DOE-MACSYMA

Tracker: Bugs

5 Wrong result given by coerce-float-fun - ID: 2880115
Last Update: Settings changed ( rtoy )

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.


Mario Rodriguez Riotorto ( riotorto ) - 2009-10-15 20:26

5

Closed

Fixed

Nobody/Anonymous

Lisp Core - Plotting

None

Public


Comments ( 3 )

Date: 2009-11-03 15:36
Sender: rtoy

Thanks for pointing out the second issue. Both of these are fixed in
plot.lisp, rev 1.144.

Closing bug report.


Date: 2009-11-02 20:40
Sender: riotorto

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.



Date: 2009-11-02 17:30
Sender: rtoy

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.


Attached File

No Files Currently Attached

Changes ( 4 )

Field Old Value Date By
status_id Open 2009-11-03 15:36 rtoy
resolution_id None 2009-11-03 15:36 rtoy
allow_comments 1 2009-11-03 15:36 rtoy
close_date - 2009-11-03 15:36 rtoy