From tshort.rlists at gmail.com  Tue Aug  4 16:33:50 2009
From: tshort.rlists at gmail.com (Tom Short)
Date: Tue, 4 Aug 2009 10:33:50 -0400
Subject: [Rd] Inaccurate complex arithmetic of R (Matlab is accurate)
In-Reply-To: <19063.7856.809632.43723@lynne.math.ethz.ch>
References: <f5139d6efa66.4a75bdf7@johnshopkins.edu>
	<4A76B2BE.1060301@mx.uni-saarland.de>
	<loom.20090803T130914-544@post.gmane.org>
	<19063.7856.809632.43723@lynne.math.ethz.ch>
Message-ID: <fd27013a0908040733i24d85418t1f535d0d46c93199@mail.gmail.com>

I checked, and both octave and yorick use multiplication for z^i where
i is an integer, leading to better accuracy. Octave uses an integer
power if it's stored as a double if it's close enough to an integer.
See:

http://hg.savannah.gnu.org/hgweb/octave/file/fb22dd5d6242/src/xpow.cc
http://yorick.sourcearchive.com/documentation/2.1.01cvs20060706/ops2_8c-source.html

- Tom



[Rd] Inaccurate complex arithmetic of R (Matlab is accurate)
Tom Short