rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

function simplimsubst problems #2881

Open rtoy opened 1 month ago

rtoy commented 1 month ago

Imported from SourceForge on 2024-07-07 00:14:48 Created by willisbl on 2021-09-21 10:22:22 Original: https://sourceforge.net/p/maxima/bugs/3861


The non-user level function simplimsubst evaluates a limit by direct substitution.

Near the top of simplimsubst there is a check if the expression involves any one of $atan2, $floor, %round, .... And when that's the case, simplimsubst declines direct substitution and returns nil.

There are lots of problems with this scheme. For one, the check only looks to see if these functions are in the expression, but it doesn't look to see if the argument of any of these functions depend on the limit variable. This gives rise to inconsistent results:

(%i9) limit(log(-1+%i*x) * ceiling(a),x,0,minus);
(%o9)                         - %i %pi ceiling(a)
(%i10) limit(log(-1+%i*x) * a,x,0,minus);
(%o10)                            log(- 1) a

For %o9, since the expression involves ceiling, the function simplimsubst declines to use direct substitution and the limit is computed by some other method. But for %o10, simplimsubst decides that uses direct substitution is OK and it returns a wrong value.

Further, the check declines direct substitution for many cases that are OK; for example the limit of floor(x) as x approaches 5/2 for example.

rtoy commented 1 month ago

Imported from SourceForge on 2024-07-07 00:14:49 Created by robert_dodier on 2021-11-29 05:36:57 Original: https://sourceforge.net/p/maxima/bugs/3861/#90df


I tried cutting out SIMPLIMSUBST via (defun simplimsubst (&rest a) nil) and then ran run_testsuite(tests = rtest_limit); and I found several results that are different from the expected results. Without looking more carefully, I don't know whether one set of results is better than the other.