After much too much time, I've run this one down. An easier way to make it
happen is:
2*exp(%i+%i*%pi*m),ratfac:true;
The root cause is the pip function called by %especial, called by timesin.
It doesn't work properly with ratfac = true. The fix is very simple (much
simpler than finding the problem) -- binding ratfac to false within pip.
Ran test suite OK. I'll put the fix in CVS.
(defun pip (e)
(prog (varlist d c)
(newvar e)
(cond ((not (memq '$%pi varlist)) (return nil)))
(setq varlist '($%pi))
(newvar e)
;; $ratfac must be nil so first var in CRE is %pi
(let (($ratfac nil)) (setq e (cdr (ratrep* e))))
(setq d (cdr e))
(cond ((not (atom d)) (return nil))
((equal e '(0 . 1))
(setq c 0)
(go loop)))
(setq c (pterm (cdar e) 1))
loop (cond ((atom c)
(cond ((equal c 0) (return nil))
((equal 1 d) (return c))
(t (return (list '(rat) c d))))))
(setq c (pterm (cdr c) 0))
(go loop)))