(1) There is a bug in sign
(%i1) sign((sqrt(3)-2)*x);
(%o1) NEG
This should evaluate to PNZ.
(2) The author of trigi.lisp was brave ---- the macro cons-exp forces a
re-simplification:
(defmfun simp-%cos (form y z)
....
((and $trigsign (mminusp* y)) (cons-exp '%cos (neg y)))
(t (eqtest (list '(%cos) y) form))))
I'd guess there are other infinite loop bugs in trigi.
(3) I think the trigonometric simplification functions work too hard to
try to apply the even / odd function simplifications. I changed
mminusp* from
(defmfun mminusp* (x)
(let (sign)
(setq sign (csign x))
(or (memq sign '($neg $nz))
(and (mminusp x) (not (memq sign '($pos $pz)))))))
to
(defun mminusp* (x)
(or (and (mnump x) (mgrp 0 x)) (and (mtimesp x) (mminusp* (car (margs
x))))))
After doing this, the testsuite shows 4 errors (rtest12 72, 71, 69, 68).
But I don't think any of
these errors are mathematical errors.
Barton