From c937c12bc3bb154b7f01eead02b63e42df1456ea Mon Sep 17 00:00:00 2001 From: Raymond Toy Date: Sat, 29 Jun 2024 14:28:49 -0700 Subject: [PATCH] Add upper limit arg to log-transform `log-transform` was accessing the special variable `*ul*`. Instead, add a `ul` arg for the upper limit and rename `*ul*` to `ul`. Update callers to pass in the upper limit to these functions. Full testsuite + share pass (with 1 expected failure) with cmucl and ccl64. --- src/defint.lisp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/defint.lisp b/src/defint.lisp index 80ac9d07a..6f4fe97c3 100644 --- a/src/defint.lisp +++ b/src/defint.lisp @@ -1601,7 +1601,7 @@ in the interval of integration.") ;; This only handles the case when the F(z) is a ;; rational function. (return (m* (m// nc dc) ans))) - ((setq ans (log-transform (m*l pp) (m*l pe) d ivar)) + ((setq ans (log-transform (m*l pp) (m*l pe) d ivar ul)) ;; If we get here, F(z) is not a rational function. ;; We transform it using the substitution x=log(y) ;; which gives us an integral of the form @@ -2814,11 +2814,11 @@ in the interval of integration.") ;; transformation y = exp(x) to get ;; integrate(p(log(y))*f(y)/g(y)/y,y,0,inf). This should be handled ;; by dintlog. -(defun log-transform (p pe d ivar) +(defun log-transform (p pe d ivar ul) (let ((new-p (subst (list '(%log) ivar) ivar p)) (new-pe (subst ivar 'z* (catch 'pin%ex (pin%ex pe ivar)))) (new-d (subst ivar 'z* (catch 'pin%ex (pin%ex d ivar))))) - (defint (div (div (mul new-p new-pe) new-d) ivar) ivar 0 *ul*))) + (defint (div (div (mul new-p new-pe) new-d) ivar) ivar 0 ul))) ;; This implements Wang's algorithm in Chapter 5.2, pp. 98-100. ;; -- 2.11.4.GIT