From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 17782 invoked from network); 29 Jul 1999 14:17:25 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 29 Jul 1999 14:17:25 -0000 Received: from mgw-x1.nokia.com (mgw-x1.nokia.com [131.228.20.21]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id KAA25197 for ; Thu, 29 Jul 1999 10:17:24 -0400 Received: from mgw-i1.ntc.nokia.com (mgw-i1.ntc.nokia.com [131.228.118.60]) by mgw-x1.nokia.com (8.9.3/8.9.3) with ESMTP id RAA14518 for ; Thu, 29 Jul 1999 17:17:22 +0300 (EETDST) Received: from ducati.uk.ntc.nokia.com (ducati.uk.ntc.nokia.com [131.228.132.169]) by mgw-i1.ntc.nokia.com (8.9.3/8.9.3) with SMTP id RAA08851 for ; Thu, 29 Jul 1999 17:17:20 +0300 (EETDST) Received: from mvagusta by ducati.uk.ntc.nokia.com (SMI-8.6/SMI-SVR4) id PAA11201; Thu, 29 Jul 1999 15:16:49 +0100 Received: from localhost (localhost [127.0.0.1]) by mvagusta (SMI-8.6/8.6.9) with ESMTP id PAA24277 for ; Thu, 29 Jul 1999 15:17:18 +0100 Date: Thu, 29 Jul 1999 15:17:17 +0100 (WET DST) From: Phil Carmody X-Sender: carmody@mvagusta.uk.ntc.nokia.com To: axp-list@redhat.com Subject: Re: Float Pt Precision In-Reply-To: <37A055F8.F9CEC671@voicenet.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Thu, 29 Jul 1999, EXT 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 To judge the errors involved, it would be easier if you'd converted these to human readable form and provided us with the input values. My guess is that you're suffering from canelling. It frequently happens that subtraction can yield hopelessly imprecise answers. > I suppose that this can be chalked up to the extended ( 80bit) precision > on the Intel box, Indeed, consider it to have 18 guard digits, to alpha's 2 (a guess) Crays (e.g. Y-MPs) are worse... (0 guard digits) > 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. Alas there's not much you can do, apart from reading "What every computer scientist should know about floating point arithmetic" by Professer Kahan. It comes bundled on every Sun system I've seen, and is freely available on the internet. (it's name may be slightly different, but the gist is there). Once armed with that you're as well equipt as anyone can be to tackle the problem. > 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. > > 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. > > gat > > BTW as a side issue, there doesn't seem to be any way to get the > compiler to do different 'rounding' techniques. Ie chopped, +infinity, > -Infinity. In C there isn't a way to specify this. C defines the rounding which should be used, and it's non IEEE 754/854 compliant. Alas. If there are any particular expresssions which are giving you problems, then I'm sure there are other mathematicians on the list who'd be prepared to cast a numerical analyst's eye to try to help find workarounds. It's annoying keyhole work, but it sounds as if it may be necessary. Good luck, Phil -- Phil Carmody. Not speaking for or on behalf of Nokia Telecommunications Quoted-Printable: a standard for mangling Internet messages Quoted-Unreadable: the result of applying said standard Unquoted-Unprintable: the comments from the recipients of the above -- bf8