From: Rupert Swarbrick <rswarbrick@us...>  20140729 22:39:49

This is an automated email from the git hooks/postreceive script. It was generated because a ref change was pushed to the repository containing the project "Maxima CAS". The branch, master has been updated via 508794f4c6a115bed6bfeee8848256898eda9910 (commit) from a2b80c7e4feda95697f28a3c8479d63aad9c1c1c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.  Log  commit 508794f4c6a115bed6bfeee8848256898eda9910 Author: Rupert Swarbrick <rswarbrick@...> Date: Tue Jul 29 23:36:09 2014 +0100 Teach SP2EXPT to deal with sums in the exponent In bug #2755, when you do powerseries (%e^x, x, 1); you end up calling something like (SP2EXPT '((MEXPT SIMP) $%E ((MPLUS SIMP) 1 #:G242909))) Because 1 + var is not a monomial in var, the previous version of the code gave up. This patch teaches it to do the product if required. Note that powerseries(a^x, x, 1) worked before because the exponent appeared in the form x*log(a) which is a monomial in x. diff git a/src/series.lisp b/src/series.lisp index 0114b84..59d7575 100644  a/src/series.lisp +++ b/src/series.lisp @@ 399,24 +399,41 @@ (m e 1) nil nil)) (defun sp2expt (exp)  (cond ((and (numberp (caddr exp)) (mexptp (cadr exp)))  (sp2expt (m^ (cadr (cadr exp))  (m* (caddr exp) (caddr (cadr exp))))))  ((and (free (caddr exp) var)  (signp g (caddr exp))  (< (caddr exp) $maxposex))  (m*l (dup (sp2expand (cadr exp)) (caddr exp))))  ((free (cadr exp) var)  (sp2sub (subst *index  '*index  (subst (cond ((eq (cadr exp) '$%e) 'sp2var)  (t (list '(mtimes)  (list '(mlog) (cadr exp))  'sp2var)))  'sp2var  (get 'mexpt 'sp2)))  (caddr exp)))  (t (throw 'psex nil)))) + (let ((base (cadr exp)) + (power (caddr exp))) + (cond + ;; Do (a^b)^c = a^(bc) when c is a number + ((and (numberp power) (mexptp base)) + (sp2expt (m^ (cadr base) + (m* power (caddr base))))) + + ;; If a positive power which is free of the expansion variable and less + ;; than the maximum expansion power then expand the base and do the + ;; multiplication explicitly. + ((and (free power var) + (signp g power) + (< power $maxposex)) + (m*l (dup (sp2expand base) power))) + + ;; If the base is free of VAR, rewrite as a^b = e^(b log(a)) if necessary + ;; and then use the tabulated expansion of exp(x). If POWER is a sum then + ;; do the rewrite a^(b+c) = a^b a^c + ((free base var) + (let ((expansion + (subst *index '*index + (if (eq base '$%e) + (get 'mexpt 'sp2) + (subst `((mtimes) ((mlog) ,base) sp2var) 'sp2var + (get 'mexpt 'sp2)))))) + (cond + ((not (mplusp power)) + (sp2sub expansion power)) + + (t + (m*l (mapcar (lambda (summand) (sp2sub expansion summand)) + (cdr power))))))) + + (t (throw 'psex nil))))) (defun dup (x %n) (if (= %n 1) diff git a/tests/rtest16.mac b/tests/rtest16.mac index 7520934..9abd38b 100644  a/tests/rtest16.mac +++ b/tests/rtest16.mac @@ 2047,3 +2047,7 @@ block([inf_exp, minf_exp], /* #2765: powerseries with noninteger order */ powerseries (diff (f(x), x, biggles), x, 0); "Failed to expand"$ + +/* #2755: powerseries of natural exponential */ +niceindices (powerseries (%e^x, x, 1)); +sum (1/i!, i, 0, inf) * sum((x1)^i/i!, i, 0, inf)$  Summary of changes: src/series.lisp  53 +++++++++++++++++++++++++++++++++++ tests/rtest16.mac  4 ++++ 2 files changed, 39 insertions(+), 18 deletions() hooks/postreceive  Maxima CAS 