From owner-cvs-src@FreeBSD.ORG Fri Mar 7 02:22:54 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 315BC1065674; Fri, 7 Mar 2008 02:22:54 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id B229E8FC16; Fri, 7 Mar 2008 02:22:53 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.2/8.14.2) with ESMTP id m272OGdW054373; Thu, 6 Mar 2008 21:24:16 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.2/8.14.2/Submit) id m272OG0n054372; Thu, 6 Mar 2008 21:24:16 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Thu, 6 Mar 2008 21:24:16 -0500 From: David Schultz To: Colin Percival Message-ID: <20080307022416.GA53988@zim.MIT.EDU> Mail-Followup-To: Colin Percival , Bruce Evans , src-committers@FreeBSD.ORG, cvs-src@FreeBSD.ORG, cvs-all@FreeBSD.ORG References: <200803051121.m25BLE03035426@repoman.freebsd.org> <20080305182531.GS68971@server.vk2pj.dyndns.org> <20080306021222.GA46783@zim.MIT.EDU> <47CF5D19.3090100@freebsd.org> <20080306033246.GA47280@zim.MIT.EDU> <47CF7EBF.6000009@freebsd.org> <20080306063452.GB48339@zim.MIT.EDU> <47CF9586.70707@freebsd.org> <20080307085031.P10724@delplex.bde.org> <47D089A4.4060208@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <47D089A4.4060208@freebsd.org> Cc: cvs-src@FreeBSD.ORG, src-committers@FreeBSD.ORG, Bruce Evans , cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/sys/i386/include _types.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2008 02:22:54 -0000 On Thu, Mar 06, 2008, Colin Percival wrote: > explicit or implicit final destination. When a variable with a declared format > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > is a final destination, as in format conversion to a variable, that declared > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > format of that variable governs its rounding. The format of an implicit > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > destination, or of an explicit destination without a declared format, is > defined by language standard expression evaluation rules. I think you missed the point about implicit destinations. See the part I quoted in the last email I sent you. The point is that in an expression like 'z = x * y', there are two operations: register <-- x * y z <-- register The register is an implicit destination. IEEE 754R explains this in more detail. All that is guaranteed in this case is that the wider register value is never substituted for z in subsequent operations. (This is part of what gcc gets wrong.) > > In C, with FLT_EVAL_METHOD = 2 (evaluate all FP expressions in the range > > and precision of the long double type) [...] > > As someone wrote earlier, the authors of C99 were a bit confused. I can only > assume that they intended to be IEEE754-compliant and the rules concerning > FLT_EVAL_METHOD apply to *implicit* destinations only. No, they got that part right. They got some of the stuff with function arguments and return values wrong in some pretty special and bizarre ways. Part of this is trying to cope with existing calling conventions, and part of it is just mistakes. > > We require error bounds of < 1 ulp and aim for < 0.5[0]1 ulps. > > What standard states that those bounds are required (or can be relied upon > when proving that code is correct)? Intel FPUs over the years have been > variously documented to compute transcendental functions to within 1.0, 2.5, > or 3.5 ulp -- are you saying that the 8087 doesn't comply with the standard > which it inspired? There's no standard requirements, but a max error < 0.50x ulps implies correct rounding nearly all of the time, and that's what libm attempts to provide. This is about the best you can do without resorting to multiprecision arithmetic in the hard cases, so it seems like a good tradeoff between accuracy and ease of implementation. When substantially faster and slightly less accurate MD implementations are available, that changes the tradeoff.