On Thu, Aug 28, 2008 at 3:45 PM, Moshe Looks <madscience at google.com> wrote:
> abs(-0.2+x^0.70086);...gives [error]...
> 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.
> ...attempts to factor any expression with less than 51 conses....
> 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.
>
Obviously the 51-cons heuristic is silly in every way. There is no point in
factoring x^3-1 or x^3-2 even though they are very small expressions, and
there are some quite large expressions that it's perfectly reasonable to
factor for sign-testing.
There are several ways to improve this, all of them useful both separately
and together:
1) Analyze more special cases, e.g. of the form x^A+B, perhaps using solve.
2) Have a way of performing time-limited calculations (if the calculation
can't be performed in 10 mS, go on to the next heuristic) -- this might be
challenging given that Maxima is supported on a variety of Lisps with
different system facilities.
3) Limit the expressions to be factored more intelligently (maximum
exponent, float exponents, fractional exponents, etc.).
-s