division by zero & definite integrals



>>>>> "Barton" == Barton Willis <willisb at unk.edu> writes:

    Barton> Let's trace simpexpt while evaluating integrate(sqrt(x +
    Barton> 1/x-2),x,0,1).Yikes!

    1> (SIMPEXPT ((MEXPT) 0 -1) 1 NIL) 1> (SIMPEXPT ((MEXPT) $X -1) 1 T)

Neat.

I was able to trace this and get a backtrace (with cmucl):


0: (SIMPEXPT ((MEXPT) 0 -1) 1 NIL)
1: (SUBST1 ((MPLUS SIMP) -2 ((MEXPT SIMP) $X -1) $X))
2: (MAXIMA-SUBSTITUTE 0 $X ((MPLUS SIMP) -2 ((MEXPT SIMP) $X -1) $X))
3: (NO-ERR-SUB 0 ((MPLUS SIMP) -2 ((MEXPT SIMP) $X -1) $X))
4: (BX**N+A ((MPLUS SIMP) -2 ((MEXPT SIMP) $X -1) $X))
5: (BXM ((MPLUS SIMP) -2 ((MEXPT SIMP) $X -1) $X) NIL)
6: (BATA0 ((MPLUS SIMP) -2 ((MEXPT SIMP) $X -1) $X))
7: (BATA0
    ((MEXPT SIMP) ((MPLUS SIMP) -2 ((MEXPT SIMP) $X -1) $X) ((RAT SIMP) 1 2)))
8: (BATAP-NEW
    ((MEXPT SIMP) ((MPLUS SIMP) -2 ((MEXPT SIMP) $X -1) $X) ((RAT SIMP) 1 2)))

And looking at the code it's trying to match b*x^n+a, and tries to
determine a by substituting 0 for x.  Any errors are caught by
NO-ERR-SUB.

I guess this is a spaghetti test. :-)

Ray