From: "Wes Bauske" <wsb@paralleldata.com>
To: axp-list@redhat.com
Subject: Re: Float Pt Precision
Date: Thu, 29 Jul 1999 11:39:12 -0500 [thread overview]
Message-ID: <37A083B0.8B46CEFD@paralleldata.com> (raw)
In-Reply-To: 37A055F8.F9CEC671@voicenet.com
Uncle George wrote:
>
> Been trying to determine why the double's between an Intel Box & and
> Alpha box are different on postgresql.
>
> The algoritms:
> 1a) t1.q = result.A * pt1.x;
> 1b) t2.q = pt1.y - t1.q;
>
> and
>
> 2) t3.q = result.C = pt1.y - result.A * pt1.x;
>
> will produce the same results on the Alpha 0x402ec4ec4ec4ec50,
> but will produce different results in the intel 0x402ec4ec4ec4ec50,
> 0x402ec4ec4ec4ec54
>
That means the Alpha follows the IEEE rules well compared to
the Intel.
Anyway, never do bit compares with FP results. It's a waste of
your time. Only look at the magnitude of the difference.
In my types of code, I look at how many DB down the difference
is to decide if it's the same answer. Lots of things can
effect how the answer turns out. Order of calculation and
optimizations quite commonly change the answer slightly.
Either you want performance and take a non-bit level identical
answers between machine types, or you end up with poor performing
code that might get the same results if you enforce IEEE 64 bit
arithmetic.
As long as your algorithm is not sensitive to low bit errors
you'll be fine. In other words you don't subtract almost
exactly the same numbers from each other. (finite differences)
If you do, then you need to worry about numerical viscosity
and how the HW rounds it's answers.
Keep in mind, FP representation is an approximation to the mathmetically
correct answer when the exponent gets larger anyway.
Wes
next prev parent reply other threads:[~1999-07-29 16:38 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
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 [this message]
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