From owner-cvs-src@FreeBSD.ORG Tue Nov 29 00:49:22 2005 Return-Path: X-Original-To: cvs-src@freebsd.org Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1658116A41F; Tue, 29 Nov 2005 00:49:22 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailout1.pacific.net.au (mailout1.pacific.net.au [61.8.0.84]) by mx1.FreeBSD.org (Postfix) with ESMTP id 14DA743D6D; Tue, 29 Nov 2005 00:49:17 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86]) by mailout1.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id jAT0nGbs011713; Tue, 29 Nov 2005 11:49:16 +1100 Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailproxy1.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id jAT0nDHU018004; Tue, 29 Nov 2005 11:49:14 +1100 Date: Tue, 29 Nov 2005 11:49:13 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Steve Kargl In-Reply-To: <20051128172718.GA59929@troutmask.apl.washington.edu> Message-ID: <20051129110058.T33820@delplex.bde.org> References: <200511280832.jAS8WGvs059057@repoman.freebsd.org> <438AD8FB.A8B96AB6@freebsd.org> <20051128172718.GA59929@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: cvs-src@freebsd.org, src-committers@freebsd.org, Andre Oppermann , Bruce Evans , cvs-all@freebsd.org Subject: Re: cvs commit: src/lib/msun/src e_lgammaf_r.c 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: Tue, 29 Nov 2005 00:49:22 -0000 On Mon, 28 Nov 2005, Steve Kargl wrote: > On Mon, Nov 28, 2005 at 11:16:27AM +0100, Andre Oppermann wrote: >> Bruce Evans wrote: >>> ... >>> lib/msun/src e_lgammaf_r.c >>> Log: >>> Fixed about 50 million errors of infinity ulps and about 3 million errors >>> of between 1.0 and 1.8509 ulps for lgammaf(x) with x between -2**-21 and >>> -2**-70. >> >> What is an ULP and are you going to write a paper on how FreeBSD has >> the best, fastest and most precise msun library of all OSs? > > Units in the Last Place. > http://docs.sun.com/source/806-3568/ncg_goldberg.html Yes, that is probably the best reference. Knuth is also good. See also ieee(3) and . The expression b**(1-p) (FLT_EPSILON, etc.) in is 1 ulp according to 1 sentence in Knuth, but this is only 1 ulp for values normalized to be >= 1.0 and < 2.0. Generally, an ulp is just like FLT_EPSILON, with the epsilon normalized to the same precision as the value instead of the value normalized to the same precision as the epsilon. I don't like writing papers, and rarely read them these days. ISTR reading the Goldberg one when it was first published not long before I almost stopped reading many technical paper papers. Hopefully at least Sun still knows everything in docs.sun.com and has the most precise if not the fastest libm. The history of {t,l}gamma's precision is interesting. The old BSD libm one (actually not so old; it is by McIlroy in {Oct,Nov} 1992) tries much harder than the (1993) fdlibm one to be precise. We still use it for tgamma. For lgamma, I think it achieves more precision for positive args. On negative args, it comments that "all bets are off" because cases like lgamma(-2.4...) have a result near 0. Such cases are especially hard to make precise and lgamma's implementation is especially unsuitable for making them precise (it uses essentially lgamma(x) = log(f(x)/g(x)) = log(f(x)) - log(g(x)), where f(x) and g(x) are large, so almost all precision is lost to cancellation when the difference is small). Bruce