From: Christophe Rhodes Date: Tue, 8 Jun 2004 10:36:52 +0000 (+0000) Subject: 0.8.11.1: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=7665c62819f24bac3445e7eb5bb3428f48ecb120;p=sbcl.git 0.8.11.1: Fixed bugs in ATANH ... (atanh #c(1 )) now computes the right answer; ... (atanh ) now does the right thing too. --- diff --git a/BUGS b/BUGS index f75671b..e41f9e5 100644 --- a/BUGS +++ b/BUGS @@ -1495,19 +1495,6 @@ WORKAROUND: when called with arguments (NIL). -335: "ATANH completely broken" - a. (reported by Peter Graves sbcl-devel 2004-06-01) - (atanh #c(1 2)), and more generally atanh of any complex with real - part 1, computes entirely the wrong answer. - b. (discovered by CSR when investigating a.) - (atanh most-positive-double-float), and more generally atanh of any - number with magnitude larger than - sqrt(most-positive-double-float), computes a number whose real - part is the imaginary part of the correct answer, and whose - imaginary part is the real part of the correct answer. - (fixes for both of these were sent CSR sbcl-devel 2004-06-02, to be merged - post-0.8.11) - 336: "slot-definitions must retain the generic functions of accessors" reported by Tony Martinez: (defclass foo () ((bar :reader foo-bar))) diff --git a/NEWS b/NEWS index 8bebd46..56a74b6 100644 --- a/NEWS +++ b/NEWS @@ -2518,6 +2518,10 @@ changes in sbcl-0.8.11 relative to sbcl-0.8.10: ** ensured that pathnames, where they have a namestring, always print using #P"..." syntax. +changes in sbcl-0.8.12 relative to sbcl-0.8.11: + * fixed bug 335: ATANH now computes the inverse hyperbolic tangent + even for difficult arguments. (reported by Peter Graves) + planned incompatible changes in 0.8.x: * (not done yet, but planned:) When the profiling interface settles down, it might impact TRACE. They both encapsulate functions, and diff --git a/src/code/irrat.lisp b/src/code/irrat.lisp index e308197..e7131b0 100644 --- a/src/code/irrat.lisp +++ b/src/code/irrat.lisp @@ -879,25 +879,25 @@ (declare (optimize (speed 3))) (cond ((or (> x theta) (> (abs y) theta)) - ;; To avoid overflow... - (setf eta (float-sign y half-pi)) - ;; nu is real part of 1/(x + iy). This is x/(x^2+y^2), + ;; To avoid overflow... + (setf nu (float-sign y half-pi)) + ;; ETA is real part of 1/(x + iy). This is x/(x^2+y^2), ;; which can cause overflow. Arrange this computation so ;; that it won't overflow. - (setf nu (let* ((x-bigger (> x (abs y))) - (r (if x-bigger (/ y x) (/ x y))) - (d (+ 1.0d0 (* r r)))) - (if x-bigger - (/ (/ x) d) - (/ (/ r y) d))))) + (setf eta (let* ((x-bigger (> x (abs y))) + (r (if x-bigger (/ y x) (/ x y))) + (d (+ 1.0d0 (* r r)))) + (if x-bigger + (/ (/ x) d) + (/ (/ r y) d))))) ((= x 1.0d0) ;; Should this be changed so that if y is zero, eta is set ;; to +infinity instead of approx 176? In any case ;; tanh(176) is 1.0d0 within working precision. (let ((t1 (+ 4d0 (square y))) (t2 (+ (abs y) rho))) - (setf eta (log (/ (sqrt (sqrt t1))) - (sqrt t2))) + (setf eta (log (/ (sqrt (sqrt t1)) + (sqrt t2)))) (setf nu (* 0.5d0 (float-sign y (+ half-pi (atan (* 0.5d0 t2)))))))) diff --git a/version.lisp-expr b/version.lisp-expr index 714e7e0..e1f2b9f 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.8.11" +"0.8.11.1"