Serious bug in Bug in integrate ?



On 3/22/07, Juan Pablo Romero Bernal <jromerobernal at gmail.com> wrote:
> (%i2) integrate((2*x+1)*sin(x),x,0,4),numer;
> Maxima encountered a Lisp error:

It turns out that this is a simplification bug:

       exp(-%i*x),numer => internal error
       log(-%i*x),numer => internal error
       sqrt(-%i*x),numer => internal error

The error shows up in double-float-eval:
   Error in ZEROP [or a callee]: ((MTIMES SIMP) -1.0 $X) is not of type NUMBER.

This was introduced in 1.16 or 1.17, when double-float-eval started
being used in simp.lisp.  This change also introduced another bug:

        sqrt(-1.0) => 1.0 %i + 6.123E-17
versys
        (-1.0)^(1/2) => 1.0 * %i

This is because simpsqrt calls the floating-point square root routine
directly, rather than going through simpexpt, but sqrt(x) should
always be exactly equivalent to x^(1/2).

             -s