[Git][cmucl/cmucl][rtoyissue78unnededcodecodeincomplexacos] Derive the values on the branch cuts for atanh
Raymond Toy
gitlab at commonlisp.net
Sun May 24 15:10:48 UTC 2020
Raymond Toy pushed to branch rtoyissue78unnededcodecodeincomplexacos at cmucl / cmucl
Commits:
fe15b0a3 by Raymond Toy at 20200524T08:10:3907:00
Derive the values on the branch cuts for atanh
Conclusion: atanh is continuous with quadrant Iv for x > 1 and
quadrant II for x < 1. This, of course, is consistent with Kahan's
coutnerclowkwise continuity principla.
    
1 changed file:
 src/code/irrat.lisp
Changes:
=====================================
src/code/irrat.lisp
=====================================
@@ 1449,7 +1449,44 @@ Z may be any number, but the result is always a complex."
;; +infinity, but the following code returns approx 176 + i*pi/4. The
;; reason for the imaginary part is caused by the fact that arg i*y is
;; never 0 since we have positive and negative zeroes.

+;;
+;; The branch cut for atanh is on the real axis for x < 1 and x > 1.
+;; Let's derive the values on the branch cut.
+;;
+;; atanh(z) = 1/2*(log(1+z)log(1z))
+;;
+;; For z = x, x > 1:
+;; atanh(x) = 1/2*(log(1+x)  log(1x))
+;; = 1/2*(log(1+x)  [log(x1) + i*arg(1x))
+;; = 1/2*(log(1+x)  (log(x1) + i*pi))
+;; = 1/2*(log(1+x)  log(x1) _ i*pi)
+;; = 1/2*log((1+x)/(x1))  i*pi/2
+;;
+;; For z = x, x > 1
+;; atanh(x) = 1/2*(log(1x)  log(1+x))
+;; = 1/2*((log(x1) + i*arg(1x))  log(1+x))
+;; = 1/2*((log(x1) + i*pi)  log(1+x))
+;; = 1/2*(log((x1)/(x+1)) + i*pi)
+;; = 1/2*log((x1)/(x+1)) + i*pi/2
+;;
+;; For z = x  i0, x > 1
+;; atanh(z) = 1/2*(log(1+x  i0)  log(1x+i0))
+;; = 1/2*(log(1+x) + i*arg(1+x,0)  (log(x1) + i*arg(1x, +0)))
+;; = 1/2*(log(1+x)  i*0  (log(x1) + i*pi))
+;; = 1/2*(log(1+x)  log(x1)  i*pi)
+;; = 1/2*log((1+x)/(x1))  i*pi/2
+;;
+;; This is the same answer we get for atanh(x), x > 1. Hence, atanh
+;; is continuous with quadrant IV along the branch cut x > 1.
+;;
+;; Similary, for z = x + i0, x > 1:
+;; atanh(z) = 1/2*(log(1x + i0)  log(1+xi0))
+;; = 1/2*((log(x1) + i*arg(1x, +0))  (log(1+x)+i*arg(1+x, 0)))
+;; = 1/2*(log(x1) + i*pi  (log(1+x)  i0))
+;; = 1/2*(log(x1)  log(1+x) + i*pi)
+;; = 1/2*log((x1)/(x+1)) + i*pi/2
+;; This is same answer as atanh(x), x < 1. Thus, atanh is continuous
+;; with quadrant II on the branch cut for x < 1
(defun complexatanh (z)
"Compute atanh z = (log(1+z)  log(1z))/2"
(declare (number z))
View it on GitLab: https://gitlab.commonlisp.net/cmucl/cmucl//commit/fe15b0a31119288135a67ab0a26f65b48e704fe8

View it on GitLab: https://gitlab.commonlisp.net/cmucl/cmucl//commit/fe15b0a31119288135a67ab0a26f65b48e704fe8
You're receiving this email because of your account on gitlab.commonlisp.net.
 next part 
An HTML attachment was scrubbed...
URL: <https://mailman.commonlisp.net/pipermail/cmuclcvs/attachments/20200524/74081a2b/attachment0001.htm>
More information about the cmuclcvs
mailing list