From: Kris K. <kj...@us...> - 2013-12-28 03:48:07
|
This is an automated email from the git hooks/post-receive 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 f1f13c8bd458aa0d42af101c91c25934edcf3a61 (commit) via 402223f1d021285ed939cb44b26b94584ae8464a (commit) via e0162a65cb4246bc53b739dd8d4e74c8a141c95c (commit) via 2c80c5a11c93718f7d79aa13303ab4db144a5d96 (commit) via 35c8ee6f8d3e6294e701fad13d713942083658a4 (commit) via 35c9f6cfb3518a95b9095f4e296baef51bbbb80a (commit) from 1ead11f83dd5c6638b5154b800c3a16d56c382a4 (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 f1f13c8bd458aa0d42af101c91c25934edcf3a61 Author: Kris Katterjohn <kat...@gm...> Date: Fri Dec 27 21:31:14 2013 -0600 Improve handling of inf, -minf, %i*inf, etc., in expintegral functions The expintegral functions had sporadic support for inf, -minf, %i*inf, minf, -inf and -%i*inf as arguments. For example, some would allow -%i*inf but not %i*minf. Also some would take minf, -inf and inf but not -minf. This commit ties up some loose ends. The test suite runs fine. diff --git a/src/expintegral.lisp b/src/expintegral.lisp index 62b2ce4..1b96b22 100644 --- a/src/expintegral.lisp +++ b/src/expintegral.lisp @@ -1068,10 +1068,18 @@ (simp-domain-error (intl:gettext "expintegral_ei: expintegral_ei(~:M) is undefined.") arg)) - ((eq arg '$inf) '$inf) - ((or (eq arg '$minf) (alike1 arg '((mtimes) -1 $inf))) 0) - ((alike1 arg '((mtimes) $%i $inf)) (mul '$%i '$%pi)) - ((alike1 arg '((mtimes) -1 $%i $inf)) (mul -1 '$%i '$%pi)) + ((or (eq arg '$inf) + (alike1 arg '((mtimes) -1 $minf))) + '$inf) + ((or (eq arg '$minf) + (alike1 arg '((mtimes) -1 $inf))) + 0) + ((or (alike1 arg '((mtimes) $%i $inf)) + (alike1 arg '((mtimes) -1 $%i $minf))) + (mul '$%i '$%pi)) + ((or (alike1 arg '((mtimes) $%i $minf)) + (alike1 arg '((mtimes) -1 $%i $inf))) + (mul -1 '$%i '$%pi)) ;; Check numerical evaluation ((complex-float-numerical-eval-p arg) @@ -1253,7 +1261,9 @@ ((onep1 arg) (simp-domain-error (intl:gettext "expintegral_li: expintegral_li(~:M) is undefined.") arg)) - ((eq arg '$inf) '$inf) + ((or (eq arg '$inf) + (alike1 arg '((mtimes) -1 $minf))) + '$inf) ((eq arg '$infinity) '$infinity) ((complex-float-numerical-eval-p arg) @@ -1391,9 +1401,12 @@ (cond ;; Check for special values ((zerop1 arg) arg) - ((eq arg '$inf) (div '$%pi 2)) - ((eq arg '$minf) (mul -1 (div '$%pi 2))) - ((alike1 arg '((mtimes) -1 $inf)) (mul -1 (div '$%pi 2))) + ((or (eq arg '$inf) + (alike1 arg '((mtimes) -1 $minf))) + (div '$%pi 2)) + ((or (eq arg '$minf) + (alike1 arg '((mtimes) -1 $inf))) + (mul -1 (div '$%pi 2))) ;; Check for numerical evaluation ((complex-float-numerical-eval-p arg) @@ -1560,8 +1573,12 @@ (cond ;; Check for special values ((zerop1 arg) arg) - ((alike1 arg '((mtimes) $%i $inf)) (div (mul '$%i '$%pi) 2)) - ((alike1 arg '((mtimes) -1 $%i $inf)) (div (mul -1 '$%i '$%pi) 2)) + ((or (alike1 arg '((mtimes) $%i $inf)) + (alike1 arg '((mtimes) -1 $%i $minf))) + (div (mul '$%i '$%pi) 2)) + ((or (alike1 arg '((mtimes) $%i $minf)) + (alike1 arg '((mtimes) -1 $%i $inf))) + (div (mul -1 '$%i '$%pi) 2)) ;; Check for numrical evaluation ((float-numerical-eval-p arg) @@ -1734,7 +1751,9 @@ ((zerop1 arg) (simp-domain-error (intl:gettext "expintegral_ci: expintegral_ci(~:M) is undefined.") arg)) - ((eq arg '$inf) 0) + ((or (eq arg '$inf) + (alike1 arg '((mtimes) -1 $minf))) + 0) ((or (eq arg '$minf) (alike1 arg '((mtimes) -1 $inf))) (mul '$%i '$%pi)) @@ -1922,8 +1941,12 @@ (simp-domain-error (intl:gettext "expintegral_chi: expintegral_chi(~:M) is undefined.") arg)) - ((alike1 arg '((mtimes) $%i $inf)) (div (mul '$%pi '$%i) 2)) - ((alike1 arg '((mtimes) -1 $%i $inf)) (div (mul -1 '$%pi '$%i) 2)) + ((or (alike1 arg '((mtimes) $%i $inf)) + (alike1 arg '((mtimes) -1 $%i $minf))) + (div (mul '$%pi '$%i) 2)) + ((or (alike1 arg '((mtimes) $%i $minf)) + (alike1 arg '((mtimes) -1 $%i $inf))) + (div (mul -1 '$%pi '$%i) 2)) ;; Check for numerical evaluation ((complex-float-numerical-eval-p arg) commit 402223f1d021285ed939cb44b26b94584ae8464a Author: Kris Katterjohn <kat...@gm...> Date: Fri Dec 27 20:14:40 2013 -0600 Fix expintegral_ci(-inf) A typo caused this to return %pi^2 instead of %i*%pi diff --git a/src/expintegral.lisp b/src/expintegral.lisp index 8695d32..62b2ce4 100644 --- a/src/expintegral.lisp +++ b/src/expintegral.lisp @@ -1735,8 +1735,9 @@ (simp-domain-error (intl:gettext "expintegral_ci: expintegral_ci(~:M) is undefined.") arg)) ((eq arg '$inf) 0) - ((eq arg '$minf) (mul '$%i '$%pi)) - ((alike1 arg '((mtimes) -1 $inf)) (mul '$%pi '$%pi)) + ((or (eq arg '$minf) + (alike1 arg '((mtimes) -1 $inf))) + (mul '$%i '$%pi)) ;; Check for numerical evaluation ((complex-float-numerical-eval-p arg) commit e0162a65cb4246bc53b739dd8d4e74c8a141c95c Author: Kris Katterjohn <kat...@gm...> Date: Fri Dec 27 20:08:59 2013 -0600 Fix expintegral_shi(%i*inf) and expintegral_shi(-%i*inf) These were intended to return %i*%pi/2 and -%i*%pi/2, respectively, but a noun form was being returned instead due to a typo. diff --git a/src/expintegral.lisp b/src/expintegral.lisp index 271f727..8695d32 100644 --- a/src/expintegral.lisp +++ b/src/expintegral.lisp @@ -1560,8 +1560,8 @@ (cond ;; Check for special values ((zerop1 arg) arg) - ((alike1 arg '((mtimes) '$%i $inf)) (div (mul '$%i '$%pi) 2)) - ((alike1 arg '((mtimes) -1 '$%i $inf)) (div (mul -1 '$%i '$%pi) 2)) + ((alike1 arg '((mtimes) $%i $inf)) (div (mul '$%i '$%pi) 2)) + ((alike1 arg '((mtimes) -1 $%i $inf)) (div (mul -1 '$%i '$%pi) 2)) ;; Check for numrical evaluation ((float-numerical-eval-p arg) commit 2c80c5a11c93718f7d79aa13303ab4db144a5d96 Author: Kris Katterjohn <kat...@gm...> Date: Fri Dec 27 19:55:31 2013 -0600 Handle limits of expintegral_chi(z) as z->inf and z->minf diff --git a/src/expintegral.lisp b/src/expintegral.lisp index 6716233..271f727 100644 --- a/src/expintegral.lisp +++ b/src/expintegral.lisp @@ -1901,6 +1901,9 @@ (eq z '$zeroa) (eq z '$zerob)) '$minf) + ((or (eq z '$inf) + (eq z '$minf)) + '$inf) (t ;; All other cases are handled by the simplifier of the function. (take '(%expintegral_chi) z))))) diff --git a/tests/rtest_expintegral.mac b/tests/rtest_expintegral.mac index ff5c2a0..2bc0ae0 100644 --- a/tests/rtest_expintegral.mac +++ b/tests/rtest_expintegral.mac @@ -189,6 +189,14 @@ inf; limit(expintegral_shi(x),x,minf); minf; +/* Limits of expintegral_chi */ + +limit(expintegral_chi(x),x,inf); +inf; + +limit(expintegral_chi(x),x,minf); +inf; + /******************************************************************************* For a negative integer parameter we expand in a series *******************************************************************************/ commit 35c8ee6f8d3e6294e701fad13d713942083658a4 Author: Kris Katterjohn <kat...@gm...> Date: Fri Dec 27 19:46:45 2013 -0600 Add a simplim%function for expintegral_shi(z) This handles limits as z->inf and z->minf diff --git a/src/expintegral.lisp b/src/expintegral.lisp index 0552f0c..6716233 100644 --- a/src/expintegral.lisp +++ b/src/expintegral.lisp @@ -1533,6 +1533,26 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; We support a simplim%function. The function is looked up in simplimit and +;;; handles specific values of the function. + +(defprop %expintegral_shi simplim%expintegral_shi simplim%function) + +(defun simplim%expintegral_shi (expr var val) + ;; Look for the limit of the argument. + (let ((z (limit (cadr expr) var val 'think))) + (cond + ;; Handle infinities at this place + ((eq z '$inf) + '$inf) + ((eq z '$minf) + '$minf) + (t + ;; All other cases are handled by the simplifier of the function. + (take '(%expintegral_shi) z))))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + (defun simp-expintegral-shi (expr ignored z) (declare (ignore ignored)) (oneargcheck expr) diff --git a/tests/rtest_expintegral.mac b/tests/rtest_expintegral.mac index bed786e..ff5c2a0 100644 --- a/tests/rtest_expintegral.mac +++ b/tests/rtest_expintegral.mac @@ -181,6 +181,14 @@ limit(expintegral_si(x),x,inf); limit(expintegral_si(x),x,minf); -%pi/2; +/* Limits of expintegral_shi */ + +limit(expintegral_shi(x),x,inf); +inf; + +limit(expintegral_shi(x),x,minf); +minf; + /******************************************************************************* For a negative integer parameter we expand in a series *******************************************************************************/ commit 35c9f6cfb3518a95b9095f4e296baef51bbbb80a Author: Kris Katterjohn <kat...@gm...> Date: Fri Dec 27 19:39:57 2013 -0600 Add a simplim%function for expintegral_si() So now, for example, limit(expintegral_si(x),x,inf) returns %pi/2 instead of a noun form. diff --git a/src/expintegral.lisp b/src/expintegral.lisp index e438b2e..0552f0c 100644 --- a/src/expintegral.lisp +++ b/src/expintegral.lisp @@ -1372,6 +1372,18 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; We support a simplim%function. + +(defprop %expintegral_si simplim%expintegral_si simplim%function) + +(defun simplim%expintegral_si (expr var val) + ;; Look for the limit of the argument. + (let ((z (limit (cadr expr) var val 'think))) + ;; All cases are handled by the simplifier of the function. + (take '(%expintegral_si) z))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + (defun simp-expintegral-si (expr ignored z) (declare (ignore ignored)) (oneargcheck expr) diff --git a/tests/rtest_expintegral.mac b/tests/rtest_expintegral.mac index e5346bd..bed786e 100644 --- a/tests/rtest_expintegral.mac +++ b/tests/rtest_expintegral.mac @@ -173,6 +173,14 @@ realpart(expintegral_si(1+%i)); imagpart(expintegral_si(1+%i)); 1/2*%i*(expintegral_si(1-%i)-expintegral_si(1+%i)); +/* Limits of expintegral_si */ + +limit(expintegral_si(x),x,inf); +%pi/2; + +limit(expintegral_si(x),x,minf); +-%pi/2; + /******************************************************************************* For a negative integer parameter we expand in a series *******************************************************************************/ ----------------------------------------------------------------------- Summary of changes: src/expintegral.lisp | 89 +++++++++++++++++++++++++++++++++++------- tests/rtest_expintegral.mac | 24 +++++++++++ 2 files changed, 98 insertions(+), 15 deletions(-) hooks/post-receive -- Maxima CAS |