Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!weretis.net!feeder1.news.weretis.net!news.albasani.net!.POSTED!not-for-mail From: Jan Burse Newsgroups: comp.lang.java.programmer Subject: Re: higher precision doubles Date: Sun, 07 Aug 2011 01:34:11 +0200 Organization: albasani.net Lines: 32 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net Z5ejOlVFgeTU+tHZ1MyLJy+gi+XplIa30xH51R14gNkDZR4euXTBdaW65LZWiEPFIO9DvApvcwLy4uKSxyAwrA== NNTP-Posting-Date: Sat, 6 Aug 2011 23:34:11 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="Zj1rgA6eNjiDyI0rdK/1fYeULUqE/7m1tZk68N96Tp2D+v7G2iV8YyQiu+/FgCbFO1f+mP/rZYB3Q/xK8JL851/p/TmUqFnASZp8CayvGQzRbfAEn+Mpc6em7uWj7RNY"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20110706 Firefox/5.0 SeaMonkey/2.2 In-Reply-To: Cancel-Lock: sha1:y0EitEBNTIpOafAWqd98MiPzGPQ= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6840 Patricia Shanahan schrieb: > What is your general strategy for dealing with rounding error in your The same strategy like ISO LIA is following. You have the mathematical definition of sin, pi, etc.. And then you have the machine objects SIN, PI, etc.. And then you have some requirements between these two things. So each machine real x maps directly to a mathematical real, but a mathematical real maps to its nearest machine real if one exists, or if there are two such machine reals, i.e. if the mathematical real is exactly between two machine reals, then further rules might be postulated. So SIN, the machine function should ideally work as the mathematical sin, and then before returning its result pick a machine real as described above. Thats all I expect from any trigonometric package. And it is demonstrable (I guess, I didn't verify) that the ideal can be turned into a practice. Modern FPUs exactly need to do this in case they comply with some ISO LIA standard. So the requirements for sin are very high. One cannot go on an just set SIN(PI)=0. Would not pass any LIA ISO compliance test.