From owner-freebsd-numerics@FreeBSD.ORG Tue Aug 14 20:06:10 2012 Return-Path: Delivered-To: freebsd-numerics@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF0D1106564A for ; Tue, 14 Aug 2012 20:06:10 +0000 (UTC) (envelope-from stephen@missouri.edu) Received: from wilberforce.math.missouri.edu (wilberforce.math.missouri.edu [128.206.184.213]) by mx1.freebsd.org (Postfix) with ESMTP id 7B78A8FC0A for ; Tue, 14 Aug 2012 20:06:10 +0000 (UTC) Received: from [127.0.0.1] (wilberforce.math.missouri.edu [128.206.184.213]) by wilberforce.math.missouri.edu (8.14.5/8.14.5) with ESMTP id q7EK63pQ055707; Tue, 14 Aug 2012 15:06:04 -0500 (CDT) (envelope-from stephen@missouri.edu) Message-ID: <502AAFAC.4020906@missouri.edu> Date: Tue, 14 Aug 2012 15:06:04 -0500 From: Stephen Montgomery-Smith User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Steve Kargl References: <502A8CCC.5080606@missouri.edu> <20120814175257.GA69865@troutmask.apl.washington.edu> <20120814183518.GA70092@troutmask.apl.washington.edu> <502AA971.4010403@missouri.edu> <20120814195659.GA70571@troutmask.apl.washington.edu> In-Reply-To: <20120814195659.GA70571@troutmask.apl.washington.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-numerics@freebsd.org Subject: Re: Status of expl logl X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussions of high quality implementation of libm functions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Aug 2012 20:06:10 -0000 On 08/14/2012 02:56 PM, Steve Kargl wrote: > On Tue, Aug 14, 2012 at 02:39:29PM -0500, Stephen Montgomery-Smith wrote: >> On 08/14/2012 01:35 PM, Steve Kargl wrote: >>> On Tue, Aug 14, 2012 at 10:52:57AM -0700, Steve Kargl wrote: >>>> On Tue, Aug 14, 2012 at 12:37:16PM -0500, Stephen Montgomery-Smith wrote: >>>>> Are people working on expl, logl and log1pl? >>>>> >>>> >>> >>> I forgot to mention that if you're looking for another >>> function to implement, then AFAIK no one is working on >>> ld80/powl() and ld128/powl(). See the comment in >>> src/e_pow.c for the algorithm used in fdlibm. >>> >> >> So I am looking through src/e_pow.c. >> >> It seems to me that the constants L1, L2, L3, etc, are 3/5, 3/7, 3/9, >> etc, but not exactly these constants. So they must have used some >> process where they jiggled the constants around, perhaps using trial and >> error, to get a few extra ulp. Is that right? >> >> Also, I am trying to see what P1, P2, P3, etc are. They seem to be >> related to the factorial (maybe a power series related to exp(x)), but I >> must admit that I am not getting it. >> >> Is there a more detailed reference to how these numbers were obtained? >> A paper somewhere? >> >> Finally, what is ovfl (in the definition of ovt) meant to be? > > I haven't looked too closely at the details of pow[fl](). I am > not aware of any published paper that gives the details. AFAIK, > the comment in e_pow.c is only detailed description (other than > the code). I tried to find a paper about pow() implementations > on Sunday with a very cursory google search. Came up empty. > > The L and P constants are used in lines 235 and 299, > line 235: r = s2*s2*(L1+s2*(L2+s2*(L3+s2*(L4+s2*(L5+s2*L6))))); > line 299: t1 = z - t*(P1+t*(P2+t*(P3+t*(P4+t*P5)))); > > These are polynomials that are evaluated via Horner's method. > I suspect the jiggling that you mention is actually a result > of a Remes minimax procedure. > > ovfl looks like it's used to define an overflow threshold (ie, ovt). > OK. I'll look into trying to reverse engineer the code. But the new semester is starting, and I will have to go back to work. So I may put it off for a long time, or not do it. (That is to say, if someone else wants to do it, they will not be treading on my toes.)