Lisp stack overflow



-----maxima-bounces at math.utexas.edu wrote: -----

>Perhaps?Barton?can?weigh?on?this?since?he?wrote?this?and?knows?far
>better?than?I?do?about?how?and?what?this?is?supposed?to?do.

Maybe I've missed something in this discussion, but one way around this bug is
to have apply-reflection-simp (defined in trigi.lisp) check both (great (neg x) x) 
and (not (great x (neg x)))):

(defun apply-reflection-simp (op x &optional (b t))
  (let ((f (get op 'reflection-rule)))
    (if (and b f (great (neg x) x) (not (great x (neg x)))) (funcall f op x) nil)))

The correct fix is to repair 'great.' But as we've discussed before, changing 'great'
might break many test results, introduce subtle bugs, or slow Maxima.
  
I didn't look at the function neg; if the function neg sometimes returns unsimplified expressions, 
maybe neg should be changed to simply multiply by -1.


--Barton