From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 3343 invoked from network); 29 Jul 1999 14:01:55 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 29 Jul 1999 14:01:54 -0000 Received: from iplink.net (iplink.net [192.139.81.2]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id KAA23650 for ; Thu, 29 Jul 1999 10:01:51 -0400 Received: from iplink.net ([192.139.81.2]:25354 "EHLO caesar.iplink.net" ident: "NO-IDENT-SERVICE") by caesar.iplink.net with ESMTP id <32434-8959>; Thu, 29 Jul 1999 10:03:47 -0400 Date: Thu, 29 Jul 1999 10:03:47 -0400 (EDT) From: Alvin Starr 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, 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 ||