Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: "Michael J. Donahue" <donahue@saaz.cam.nist.gov>
To: axp-list@redhat.com
Subject: Re: Float Pt Precision
Date: Thu, 29 Jul 1999 11:57:57 -0400	[thread overview]
Message-ID: <199907291557.LAA17800@saaz.cam.nist.gov> (raw)
In-Reply-To: <Pine.GSO.4.10.9907291519480.7300-100000@mvagusta.uk.ntc.nokia.com> (message from Phil Carmody on Thu, 29 Jul 1999 15:32:24 +0100 (WET DST))

Phil Carmody wrote:
>For every architecture, where e = machine epsilon:
>(-1 + 1) + e == e     
>but
>     (1 + e) - 1 == e

To be precise, e is the smallest number such that 1+e != 1.  So if we
take 0<e'<e, then

    (-1 + 1) + e' == e'
but
    (1 + e') - 1  == 0

>The a rule of thumb in these matters is to try to split the 'small'
>data from the 'large' data, and handle all the 'small' data first before
>it gets swamped by the 'large' data.
>
>
>Oh - I was incorrect with my previous reference:
>"What every computer scientist should know about floating point
>arithmetic" is by Goldberg, not Kahan. However, it's 'in the style' of
>similar things by Kahan.

You can find some of Kahan's work at http://www.cs.berkeley.edu/~wkahan/.
For example,

  How JAVA's Floating-Point Hurts Everyone Everywhere
   http://www.cs.berkeley.edu/~wkahan/JAVAhurt.pdf

and

  Miscalculating Area and Angles of a Needle-like Triangle
   http://www.cs.berkeley.edu/~wkahan/Triangle.pdf

The difference in the floating point calculations on the x86 vs the
Alpha trace back to the hardware implementations.  The extra precision
in the x86 makes life much easier---it narrows the window of numerical
instability in almost every situation.

-m

-- 
Michael J. Donahue
National Institute of Standards and Technology
Mathematical & Computational Sciences Division
100 Bureau Dr Stop 8910
Gaithersburg, MD 20899-8910
email: michael.donahue@nist.gov
voice: (301) 975-5424
  fax: (301) 990-4127
  web: http://math.nist.gov/mcsd/Staff/MDonahue/


  reply	other threads:[~1999-07-29 15:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-29 13:24 Float Pt Precision Uncle George
1999-07-29 14:03 ` Alvin Starr
1999-07-29 14:32   ` Phil Carmody
1999-07-29 15:57     ` Michael J. Donahue [this message]
1999-07-29 18:51       ` Harvey J. Stein
1999-07-29 19:47         ` Wes Bauske
1999-07-29 21:05           ` Harvey J. Stein
1999-07-29 21:07         ` Michael J. Donahue
1999-07-29 14:17 ` Phil Carmody
1999-07-29 14:24 ` Christopher C Chimelis
1999-07-29 16:39 ` Wes Bauske
1999-07-29 23:42 ` Richard Henderson
1999-07-30 13:19   ` Harvey J. Stein
1999-07-30 14:38     ` Uncle George
1999-07-30 14:55   ` Uncle George
1999-07-30 11:18 ` Phil Carmody
1999-07-30 14:52   ` Uncle George
1999-07-30 15:31     ` Phil Carmody
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox