On 2013-12-15, Denis Roegel <denis.roegel at loria.fr> wrote:
> I am beginning to use maxima and the first thing I want to do is produce a table of elliptic integrals .
> I have used Ted Woollett's macros nint.mac and it works fine, except when I call it more than 1000
> times in a row. I am getting the output below. Ted had a look at my problem and suggested
> that I post it here. The file denis3.mac, as well as all the other necessary files (nint.mac)
> are available here: http://www.loria.fr/~roegel/tmp/bug.zip
Thank you for providing all the stuff necessary to recreate the bug; it
is very helpful. I have verified that the error happens w/ Maxima built
with GCL 2.6.10 (after 790 iterations). Inspecting GCL's state seems to
suggest that it has something to do with the 'assume' mechanism, which
nint uses. However, I glanced at the nint code and I didn't see any
problem with 'assume' there. My guess is that there is a problem in
'assume'; it is fairly complex, and not well understood.
As pointed out elsewhere, Maxima has built-in functions for elliptic
integrals. If you still want to use numerical integration, you might
consider calling quadpack functions directly; I guess nint is a wrapper
which calls quadpack. Replacing calls to nint with quad_qags seems to
yield the same results, without bumping into the 'assume' bug, and runs
faster, if that makes a difference.
best
Robert Dodier