From owner-svn-src-head@freebsd.org Mon Nov 9 12:03:49 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88B5BA2921C; Mon, 9 Nov 2015 12:03:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 4CBBE1C46; Mon, 9 Nov 2015 12:03:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 5E7CBD486D3; Mon, 9 Nov 2015 23:03:46 +1100 (AEDT) Date: Mon, 9 Nov 2015 23:03:45 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Garrett Cooper cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290605 - in head/lib/msun: . man In-Reply-To: <201511091040.tA9AeG0B038056@repo.freebsd.org> Message-ID: <20151109223117.Y2340@besplex.bde.org> References: <201511091040.tA9AeG0B038056@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=cK4dyQqN c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=JsMFsR0-Xu0OIYqm9CUA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 12:03:49 -0000 On Mon, 9 Nov 2015, Garrett Cooper wrote: > Log: > Document powl(3) powl was garbage that was intentionally undocumented. At least, I intentionally ignored its non-documentation together with it. > Modified: head/lib/msun/man/exp.3 > ============================================================================== > --- head/lib/msun/man/exp.3 Mon Nov 9 10:35:33 2015 (r290604) > +++ head/lib/msun/man/exp.3 Mon Nov 9 10:40:16 2015 (r290605) > @@ -99,9 +102,10 @@ functions compute the value exp(x)\-1 ac > .Fa x . > .Pp > The > -.Fn pow > +.Fn pow , > +.Fn powf , > and the > -.Fn powf > +.Fn powl > functions compute the value > of > .Ar x powl doesn't compute the value of .Ar x to the exponent .Ar y. It computes the value of (double)(.Ar x) to the exponent (double)(.Ar y), converted to double. > @@ -122,9 +126,10 @@ Otherwise the error in these functions i > These functions will return the appropriate computation unless an error > occurs or an argument is out of range. powl() almost never returns the appropriate computation. Its bugs are most obvious when an argument is too large for double but not out of range. > The functions > -.Fn pow x y > +.Fn pow x y , > +.Fn powf x y , > and > -.Fn powf x y > +.Fn powl x y > raise an invalid exception and return an \*(Na if > .Fa x > < 0 and I doubt that the rest of this section (about exception handling) is correct for powl(). The section on errors wasn't changed since it uses generic pow(). It claims that the error is generally less than 1 ulp. But for powl(), the error is generally more that 4096 ulps. Much more when the error exponentiates. powf() and pow() do well to avoid exponentiation of roundoff errors. Bruce