119 lines
5.7 KiB
HTML
119 lines
5.7 KiB
HTML
<!-- Common Lisp HyperSpec (TM), version 7.0 generated by Kent M. Pitman on Mon, 11-Apr-2005 2:31am EDT -->
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>CLHS: Issue COMPLEX-ATAN-BRANCH-CUT Writeup</TITLE>
|
|
<LINK HREF="../Data/clhs.css" REL="stylesheet" TYPE="text/css" />
|
|
<META HTTP-EQUIV="Author" CONTENT="Kent M. Pitman">
|
|
<META HTTP-EQUIV="Organization" CONTENT="LispWorks Ltd.">
|
|
<LINK REL=TOP HREF="../Front/index.htm">
|
|
<LINK REL=COPYRIGHT HREF="../Front/Help.htm#Legal">
|
|
<LINK REL=DISCLAIMER HREF="../Front/Help.htm#Disclaimer">
|
|
<LINK REL=PREV HREF="../Issues/iss068_w.htm">
|
|
<LINK REL=UP HREF="../Issues/iss069.htm">
|
|
<LINK REL=NEXT HREF="../Issues/iss070_w.htm">
|
|
</HEAD>
|
|
<BODY>
|
|
<H1><A REV=MADE HREF="http://www.lispworks.com/"><IMG WIDTH=80 HEIGHT=65 ALT="[LISPWORKS]" SRC="../Graphics/LWSmall.gif" ALIGN=Bottom></A><A REL=TOP HREF="../Front/index.htm"><IMG WIDTH=237 HEIGHT=65 ALT="[Common Lisp HyperSpec (TM)]" SRC="../Graphics/CLHS_Sm.gif" ALIGN=Bottom></A> <A REL=PREV HREF="../Issues/iss068_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="../Issues/iss069.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="../Issues/iss070_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
|
|
|
|
<HR>
|
|
|
|
|
|
|
|
<H2>Issue COMPLEX-ATAN-BRANCH-CUT Writeup</H2>
|
|
|
|
<PRE><B>Forum:</B> Cleanup<P>
|
|
<B>Issue:</B> <A HREF="iss069.htm">COMPLEX-ATAN-BRANCH-CUT</A><P>
|
|
<B>References:</B> CLtL p.208, 212<P>
|
|
Related issues: <A HREF="iss192.htm">IEEE-ATAN-BRANCH-CUT</A><P>
|
|
<B>Category:</B> CHANGE<P>
|
|
<P>
|
|
<B>Edit history:</B> Version 1, 13-Dec-88, Steele<P>
|
|
<P>
|
|
<B>Problem description:<P>
|
|
</B><P>
|
|
The formula that defines <A REL=DEFINITION HREF="../Body/f_asin_.htm#atan"><B>ATAN</B></A> results in a branch cut that is at<P>
|
|
variance with the recommendations of Prof. W. Kahan and with the<P>
|
|
implementations of that function in many computing systems and<P>
|
|
calculators.<P>
|
|
<P>
|
|
<B>Proposal (COMPLEX-ATAN-BRANCH-CUT:TWEAK):<P>
|
|
</B> <P>
|
|
Replace the formula<P>
|
|
<P>
|
|
arctan z = - i log ((1+iz) <A REL=DEFINITION HREF="../Body/f_sqrt_.htm#sqrt"><B>sqrt</B></A> (1/(1+z^2)))<P>
|
|
<P>
|
|
with the formula<P>
|
|
<P>
|
|
arctan z = (log (1+iz) - log (1-iz)) / (2i)<P>
|
|
<P>
|
|
This leaves the branch cuts pretty much in place; the only change is<P>
|
|
that the upper branch cut (on the positive imaginary axis above i)<P>
|
|
is continuous with quadrant I, where the old formula has it continuous<P>
|
|
with quadrant II.<P>
|
|
<P>
|
|
<B>Examples:<P>
|
|
</B><P>
|
|
(<A REL=DEFINITION HREF="../Body/f_asin_.htm#atan"><B>atan</B></A> #c(0 2)) => #c(-1.57... 0.549...) ;Current<P>
|
|
(<A REL=DEFINITION HREF="../Body/f_asin_.htm#atan"><B>atan</B></A> #c(0 2)) => #c(1.57... -0.549...) ;Proposed<P>
|
|
<P>
|
|
Note: 1.57... = pi/2, and 0.549... = (log 3)/2.<P>
|
|
<P>
|
|
<B>Rationale:<P>
|
|
</B><P>
|
|
Compatibility with what seems to be becoming <A REL=DEFINITION HREF="../Body/07_ffb.htm#standard"><B>standard</B></A> practice.<P>
|
|
<P>
|
|
<P>
|
|
<B>Current practice:<P>
|
|
</B><P>
|
|
(<A REL=DEFINITION HREF="../Body/f_asin_.htm#atan"><B>atan</B></A> #c(0 2)) => #c(-1.57... 0.549...) ;Symbolics CL<P>
|
|
(<A REL=DEFINITION HREF="../Body/f_asin_.htm#atan"><B>atan</B></A> #c(0 2)) => #c(-1.57... 0.549...) ;Allegro CL 1.1 (Macintosh)<P>
|
|
(<A REL=DEFINITION HREF="../Body/f_asin_.htm#atan"><B>atan</B></A> #c(0 2)) => #c(-1.57... 0.549...) ;Sun-4 CL 2.1.3 of 10-Nov-88<P>
|
|
(<A REL=DEFINITION HREF="../Body/f_asin_.htm#atan"><B>atan</B></A> #c(0 2)) => #c(1.57... -0.549...) ;Sun CL 2.0.3 of 30-Jun-87<P>
|
|
(<A REL=DEFINITION HREF="../Body/f_asin_.htm#atan"><B>atan</B></A> #c(0 2)) => #c(1.57... 0.549...) ;KCL of 3-Jun-87<P>
|
|
<P>
|
|
Note that in KCL the upper branch cut is thus continuous with<P>
|
|
quadrant I, but its lower branch cut is continuous with quadrant III!<P>
|
|
<P>
|
|
<B>Cost to Implementors:<P>
|
|
</B><P>
|
|
<A REL=DEFINITION HREF="../Body/f_asin_.htm#atan"><B>ATAN</B></A> must be rewritten. It is not a very difficult fix.<P>
|
|
<P>
|
|
<B>Cost to Users:<P>
|
|
</B><P>
|
|
It is barely conceivable that some user code could depend on this.<P>
|
|
Note that the proposed change invalidates the identities<P>
|
|
arctan i z = i arctanh z<P>
|
|
and arctanh i z = i arctan z<P>
|
|
on the upper branch cut.<P>
|
|
<P>
|
|
The compatibility note on p. 210 of CLtL gave users fair warning that<P>
|
|
a change of this kind might be adopted.<P>
|
|
<P>
|
|
<B>Cost of non-adoption:<P>
|
|
</B><P>
|
|
Incompatibility with HP calculators.<P>
|
|
<P>
|
|
<B>Benefits:<P>
|
|
</B><P>
|
|
Numerical analystsmay find the new definition easier to use.<P>
|
|
<P>
|
|
<B>Esthetics:<P>
|
|
</B><P>
|
|
A toss-up, except to those who care.<P>
|
|
<P>
|
|
<B>Discussion:<P>
|
|
</B><P>
|
|
Steele has sent a letter to W. Kahan at Berkeley to get any last<P>
|
|
comments he may have on the matter.<P>
|
|
<P>
|
|
Paul Penfield of MIT, after whose article the Common Lisp branch<P>
|
|
cuts were originally patterned, endorses this change.<P>
|
|
<P>
|
|
</PRE>
|
|
<HR>
|
|
|
|
<A REL=NAVIGATOR HREF="../Front/StartPts.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Starting Points]" SRC="../Graphics/StartPts.gif" ALIGN=Bottom></A><A REL=TOC HREF="../Front/Contents.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Contents]" SRC="../Graphics/Contents.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Master.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Index]" SRC="../Graphics/Index.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Symbol.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Symbols]" SRC="../Graphics/Symbols.gif" ALIGN=Bottom></A><A REL=GLOSSARY HREF="../Body/26_a.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Glossary]" SRC="../Graphics/Glossary.gif" ALIGN=Bottom></A><A HREF="../Front/X3J13Iss.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Issues]" SRC="../Graphics/Issues.gif" ALIGN=Bottom></A><BR>
|
|
|
|
<A REL=COPYRIGHT HREF="../Front/Help.htm#Legal"><I>Copyright 1996-2005, LispWorks Ltd. All rights reserved.</I></A><P>
|
|
</BODY>
|
|
</HTML>
|