From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA24136; Wed, 28 Mar 2001 09:21:02 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA24132 for ; Wed, 28 Mar 2001 09:21:01 +0200 (MET DST) Received: from maynard.mail.mindspring.net (maynard.mail.mindspring.net [207.69.200.243]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f2S7KxP21358 for ; Wed, 28 Mar 2001 09:21:00 +0200 (MET DST) Received: from dylan (1Cust105.tnt4.tucson.az.da.uu.net [63.11.145.105]) by maynard.mail.mindspring.net (8.9.3/8.8.5) with SMTP id CAA15495 for ; Wed, 28 Mar 2001 02:20:57 -0500 (EST) Message-ID: <002701c0b757$aefbcff0$210148bf@dylan> From: "David McClain" To: Subject: [Caml-list] Complex Arithmetic Date: Wed, 28 Mar 2001 00:21:17 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk ... now that my memory has been jogged... I believe Kahan actually stated "The language of pairs is insufficient in the complex domain." (Cryptic enough for you?) His demonstration was called "Borda's Mouthpiece" and was a simple conformal mapping problem from linear rays in the right half complex plain to the streamlines associated with a fluid flow at hypersonic speeds in a tube. Specifically, the problem in other languges is the following: Borda's Mouthpiece requires taking the square root of the square of values along the negative imaginary axis. When you square (0 - 1i) you get (-1). ...but actually you get (-1 + 0-). Most languages simply accept the square as (-1) = (-1 + 0+). Taking the subsequent square root when you have made this incorrect assumption gives the value sqrt(-1) -> (0+1i). And so the stream line mapped from the negative imaginary axis ends up cutting across all the other stream lines when this condition is encountered. An obvious error! The correct answer is obtained by noting that (0 - 1i)^2 -> (-1 + 0-) and sqrt(-1 + 0-) -> (0 -1i) again. Only by properly considering the nature of floating point zero (i.e., which of the two you really have) can you perform this computation correctly. Whew! That was a bloody difficult two weeks to go from the cryptography of Kahan to a correctly working implementation... And BTW, you DON'T want to use polar representation -- that eats away seriously at your arithmetic precision, dropping from 15 digits to something like 6-8 digits in double precision math. You have to stay in the rectangular representation to preserve arithmetic precision -- and that requires a full understanding of the nature of 0+ and 0-. - DM ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr