I just discovered something in the Common Lisp HyperSpec I missed
atan:
| The following definition for (one-argument) arc tangent determines the range
| and branch cuts:
| arctan z = log (1+iz) - log (1-iz)/(2i)
...
...
| Examples:
...
| (atan #c(0 2)) => #C(-1.5707964 0.54930615)
(I assume there should be parens around the logs)
log:
| log may return a complex when given a real negative number.
| (log -1.0) == (complex 0.0 (float pi 0.0))
...
| The branch cut for the logarithm function of one argument (natural logarithm)
| lies along the negative real axis, continuous with quadrant II. The domain
| excludes the origin.
Now, let's compute atan(2*i) = 1/(2*i) * (log(-1) - log 3)
= 1/(2*i) * (pi*i - log 3)
= pi/2 + (log 3)/2 * i
which contradicts the given example in the spec of atan. A little further
investigation revealed that there is a cleanup issue,
HyperSpec/Issues/iss069_w.htm, which mentions that with
arctan z = log (1+iz) - log (1-iz)/(2i)
branch cuts are *not* as in the spec, but rather that both are continuous with
the right half plane.
The originally proposed formula in the Common Lisp Standard (which is still
present there) was
| Arc tangent -i log ((1+ix) sqrt(1/(1+x^2)) )
and has the upper branch cut continuous with the left half plane...
I guess it's better to follow the "newer" formula?
Martin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/fricas-devel?hl=en
-~----------~----~----~----~------~----~------~--~---