With Maxima 5.38.1 compiled with ECL 16.1.2 on x86_64 Linux, one gets a lisp arithmetic error in an easy integral that does not lead to problems with the same ECL, but Maxima 5.35.1, or with Maxima 5.38.1 compiled with SBCL.
Maxima 5.38.1 http://maxima.sourceforge.net
using Lisp ECL 16.1.2
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) integrate((x^2)*exp(x) / (1 + exp(x))^2,x,-1000,1000);
Maxima encountered a Lisp error:
#<a ARITHMETIC-ERROR>
Automatically continuing.
To enable the Lisp debugger set *debugger-hook* to nil.
this popped up on https://trac.sagemath.org/ticket/18920
I see the result should be
My first guess is that this has something to do with factoring sums of exponentials which has caused trouble in various ways. To try to narrow the problem, can you enter
trace(?factor);(the question mark means it's a Lisp function) and then try the same input again. I believe we'll be able to see whether the error occurs in a call to FACTOR. In any event you can append the output to this bug report and we'll go from there.Here is the trace:
Some debugging shows the problem is in 'limit'.
The simplest related example I can find:
The problem appears to stem from this:
I'm not sure where the float infinity came from, but anyway if I work around this error, I get something that seems to be correct. Stay tuned.
I'll report the ECL bug too.
Bug reported to ECL issue tracker: https://gitlab.com/embeddable-common-lisp/ecl/issues/299
Fixed by commit e916dd0. Closing this report.
After this commit I get the following errors with both gcl and ecl.
The error seems to be caused by exp(1000) => floating point inf,
and seems to happen only after executing earlier files in the test suite.
The problem appears to be that if there is a bigfloat in the assume database for some reason, Maxima tries to compare negative float infinity to the bigfloat, and then tries to promote the float to a bigfloat, and gets the error. I'll open a new bug report about that.
I've opened #3244 to work on this problem.
The patch provided on https://gitlab.com/embeddable-common-lisp/ecl/issues/299 does fix the original issue, so perhaps a workaround is just not necessary (with their master branch, at least).