Article View: comp.lang.fortran
Article #6520Re: Precision of floating point multiply
From: Richard Maine
Date: Sat, 27 Sep 2003 16:04
Date: Sat, 27 Sep 2003 16:04
37 lines
3022 bytes
3022 bytes
"Glen Herrmannsfeldt" <gah@ugcs.caltech.edu> writes: > As far as I know, Fortran still requires floating point multiply to generate > a result with no more precision than the arguments that went into it. I disagree. I don't think that any version of the standard makes such a requirement. The standard does not specify accuracy requirements. In my opinion, you are getting into the question of computational versus mathematical differences. I just got up and don't feel like dragging out the latest standard to find the relevant citation (much less finding the similar citation in other versions), but I'm sure many here will know the one I'm referring to. The fact that the standard describes (a*b)+(c*d) interms of single precision (when a,b,c,d are all single) does not mean that the result of that computation has to be bit-by-bit identical with a naive implementation of that expression. If you go down that path, before long you'll probably conclude that the standard disallows guard bits. I simply do not believe this to be true (or ever to have been true). As someone else pointed out, the standard (as of f77, I think it was) provides the DPROD intrinsic specifically for the purpose of doing a double precision product of single precision operands. Let me note on a related matter that the standard does *NOT* require the result of dprod(a,b) to actually be any more accurate than a*b. It has to be represented in double precision, but it doesn't have to meet any particular accuracy requirements. Of course, a user is likely to expect it to, but I think that's one of thoes quality of implementation issues. If the vendor doesn't feel like bothering to do a good job of it, the standard isn't the tool that will address that problem in this case. -- Richard Maine email: my last name at domain domain: isomedia dot com
Technical Details
Message-ID:
<m28yoa5iap.fsf@vega.dsl.att.net>Path:
arc1-ca.pugleaf.net!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sn-xit-03!sn-xit-04!sn-xit-06!sn-post-01!supernews.com!news.supernews.com!not-for-mailReferences:
<dG4db.598668$uu5.97984@sccrnsc04>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fd4af,7830916812112af0 X-Google-Attributes: gidfd4af,public X-Google-Thread: fd705,7830916812112af0 X-Google-Attributes: gidfd705,public X-Google-Thread: 102b75,7830916812112af0 X-Google-Attributes: gid102b75,public X-Google-Thread: 1094ba,7830916812112af0 X-Google-Attributes: gid1094ba,public X-Google-ArrivalTime: 2003-09-27 09:04:49 PST Path: arc1-ca.pugleaf.net!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sn-xit-03!sn-xit-04!sn-xit-06!sn-post-01!supernews.com!news.supernews.com!not-for-mail From: Richard Maine <nospam@see.signature> Newsgroups: comp.lang.fortran,comp.arch,bit.listserv.ibm-main,alt.folklore.computers Subject: Re: Precision of floating point multiply Date: 27 Sep 2003 09:04:46 -0700 Organization: NASA Dryden Message-ID: <m28yoa5iap.fsf@vega.dsl.att.net> Sender: maine@vega.dsl.att.net References: <dG4db.598668$uu5.97984@sccrnsc04> User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Portable Code) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@supernews.com Lines: 37