I have recently begun playing around with maxima for a probabilistic
program evolution project that requires simplification of random
expressions. Some of these expressions use the absolute-value function
(abs) in a way that seems to lead to bad behavior by the default
simplifier. For example, doing
abs(-0.2+x^0.70086);
at the maxima prompt gives "MAKE-ARRAY: dimensions (7905 7905) produce
too large total-size" under clisp, and launches into a long (> 10 min)
computation under sbcl.
The problem is that maxima attempts to determine the sign of expr =
-0.2+x^0.70086 to see if abs(expr) can be replaced by expr or -expr.
This leads to a call to the lisp function signfactor (in
src/compar.lisp), which in turn calls the function factor-if-small
(called nowhere else, as far as I can tell), which attempts to factor
any expression with less than 51 conses. The problem is that very
small expressions such as the one above can sometimes also be
impractical to factor, not just large expressions.
As a maxima newbie, my hack to solve this is to simply disable
factor-if-small, so that maxima never attempts to factor an expression
just to determine its sign.
But does anyone here know of a clever heuristic for guessing when to
factor? Maybe one is even already implemented elsewhere in maxima?
Thanks very much,
Moshe Looks