Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Alvin Starr <alvin@iplink.net>
To: axp-list@redhat.com
Subject: Re: Float Pt Precision
Date: Thu, 29 Jul 1999 10:03:47 -0400 (EDT)	[thread overview]
Message-ID: <Pine.OSF.4.05.9907290935230.20906-100000@caesar.iplink.net> (raw)
In-Reply-To: <37A055F8.F9CEC671@voicenet.com>

On Thu, 29 Jul 1999, 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
> 
> I suppose that this can be chalked up to the extended ( 80bit) precision
> on the Intel box,

Given Intel's track record on FP. I would want to check out this result
carefully.

> BUT IT MAKES MY life at porting postgres to the alpha, as well as other
> projects very difficult to perform alike equally . A few more
> calculations, and you begin to wonder where the least sig digit has gone
> off to.

that is the nature of floating point calculations. You need to be very
carefull. The idea that the compiler optimization level can change the
results of your calculations is a bit scary though.
 
> 80 bit extended precision on alpha? This particular feature is not
> mentioned too much ( if at all ) in the alpha literature. Nor are the
> internal methods of processing floating points really described.

To my knowledge(Just checked the alpha referance manual) there is no
80 bit floating point format for the alpha. I am also not sure if the 80
bit format is an IEEE standard like the 64 and 32 bit formats.

> It seems that a lot of folks believe the FP is fast(er than the intel ),
> but it seems to be at the cost of precision. Which for me would be of
> some concern in massive numerical calculations.

This is the argument between CISC and RISC. The intel FP is in some ways
all singing and all dancing. The Alpha FP is more limited but is much
faster. If you hit a special case Intel handles it in HW, on Alpha it
becomes a SW trap. 

You should get the precision that you expect constantly and not depending
on the order of the operands. A+B+C should allways be the "exact" same as
B+C+A and not "just about" the same. If you cannot guarentee that your
data will be presented in the same order all the time what would be the
point of trying to compare the results.

Extra precision on running calculations is fine but remember "systems that
do things for you often will do things to you"

Alvin Starr                   ||   voice: (416)585-9971
Interlink Connectivity        ||   fax:   (416)585-9974
alvin@iplink.net              ||


  reply	other threads:[~1999-07-29 14:01 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 [this message]
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
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