Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#2518 solve takes infinite time and memory

None
open
nobody
solve (8)
5
2012-12-14
2012-12-14
Paulius Šarka
No

Dear developers and maintainers of Maxima,

I ran into the following problem. Trying to solve this equation

solve([z/(z-1) = (z-x)/y, (z-x)/y = y/(z-y), y/(z-y) = (z-y)/(y-1)], [x,y,z]);

fails after taking a long time (a few minutes) and a lot of memory. It eventually crashes with the message:

Maxima encountered a Lisp error:

 Error in PROGN [or a callee]: The storage for CONS is exhausted.
Currently, 39989 pages are allocated.
Use ALLOCATE to expand the space.

Automatically continuing.
To enable the Lisp debugger set *debugger-hook* to nil.

However, mindbogglingly, if I rewrite it this way:

eqs = [z/(z-1) = (z-x)/y, (z-x)/y = y/(z-y), y/(z-y) = (z-y)/(y-1)];
solve(eqs, [x,y,z]);

it computes without any difficulties:
(%o2) []

I ran into this indirectly, when using Sage. I guess Sage asks Maxima to solve this in the first form and thus hangs itself. I tried this with Maxima 5.22.1 on Mint and with sagenb.org, which reports Sage version 5.4.

Discussion