From owner-freebsd-numerics@FreeBSD.ORG Sat Sep 15 12:01:01 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 C24AC10656EB for ; Sat, 15 Sep 2012 12:01:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail36.syd.optusnet.com.au (mail36.syd.optusnet.com.au [211.29.133.76]) by mx1.freebsd.org (Postfix) with ESMTP id 3FE468FC0A for ; Sat, 15 Sep 2012 12:01:00 +0000 (UTC) Received: from c122-106-157-84.carlnfd1.nsw.optusnet.com.au (c122-106-157-84.carlnfd1.nsw.optusnet.com.au [122.106.157.84]) by mail36.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q8FC0peT008204 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 15 Sep 2012 22:00:52 +1000 Date: Sat, 15 Sep 2012 22:00:51 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Steve Kargl In-Reply-To: <20120915003408.GA70269@troutmask.apl.washington.edu> Message-ID: <20120915210927.Q2023@besplex.bde.org> References: <5048D00B.8010401@missouri.edu> <504D3CCD.2050006@missouri.edu> <504FF726.9060001@missouri.edu> <20120912191556.F1078@besplex.bde.org> <20120912225847.J1771@besplex.bde.org> <50511B40.3070009@missouri.edu> <20120913204808.T1964@besplex.bde.org> <5052A923.9030806@missouri.edu> <20120914143553.X870@besplex.bde.org> <5053CB4F.3030709@missouri.edu> <20120915003408.GA70269@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Stephen Montgomery-Smith , freebsd-numerics@freebsd.org Subject: Re: cexp error 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: Sat, 15 Sep 2012 12:01:01 -0000 On Fri, 14 Sep 2012, Steve Kargl wrote: > On Fri, Sep 14, 2012 at 07:26:55PM -0500, Stephen Montgomery-Smith wrote: >> On 09/14/2012 01:05 AM, Bruce Evans wrote: >> >>> My tests also determined the exact minimum for all multiples up to the >>> thresholds for "large" multiples in e_rem_pio2.c, except for ld128, >>> to verify that there are enough bits in the special approximations for >>> Pi/2 there, except for ld128. The maximum multiples handled there are >>> 2**28*Pi/2, except for ld128 they are 2**45*Pi/2. 2**45 is too many >>> to check exhaustively. >> >> But presumably one could prove a result to this effect using continued >> fractions, right? Yes. I'm not sure if the theory can produce a good bound for a relatively small range of x though. > See attached. It shows a method for determining the number > of needed bits. It doesn't give the details for continued fractions, but supplies the bound for 53 mantissa bits (2**-62 -> 61 extra bits), and shows that this was known in 1992, and describes the 1992 fdlibm better/differently than I described the current implementation. The 73 (75?) extra that I remembered must be for 64 mantissa bits. I have Kahan's program which does searches using the continued fraction method (das sent it to me in 2008), but don't really understand it, and in particular don't know how to hack it to give the bound for the 2**45 range. Saved results show that I didn't finish checking with it in 2008 either. Bruce