powerseries



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

>I think the function %piargs (in trigi.lisp) is buggy (it's
>possible that the bug is in %piargs-sin/cos).

Proposed fix:

(defun %piargs (x ratcoeff)
  (cond ((and (integerp (car x)) (integerp (cdr x))) 0)
 ((not (mevenp (car x)))
  (cond ((null ratcoeff) nil)
        ((and (alike1 (cdr x) '((rat) 1 2)) (integerp (car x))) ;; <--
  (integerp (car x)) is new
  (power -1 (add ratcoeff -1//2)))))
 ((or (alike1 '((rat) 1 6) (setq x (mmod (cdr x) 2))) (alike1 '((rat) 5 6)
 x)) 1//2)
 ((or (alike1 '((rat) 1 4) x) (alike1 '((rat) 3 4) x)) (div (power 2 1//2)
 2))
 ((or (alike1 '((rat) 1 3) x) (alike1 '((rat) 2 3) x)) (div (power 3 1//2)
 2))
 ((alike1 1//2 x) 1)
 ((or (alike1 '((rat) 7 6) x) (alike1 '((rat) 11 6) x)) -1//2)
 ((or (alike1 '((rat) 4 3) x) (alike1 '((rat) 5 3) x)) (div (power 3 1//2)
 -2))
 ((or (alike1 '((rat) 5 4) x) (alike1 '((rat) 7 4) x)) (mul -1//2 (power 2
 1//2)))
 ((alike1 '((rat) 3 2) x) -1)))


Yes / no / maybe?

Barton