From owner-freebsd-numerics@FreeBSD.ORG Sat Aug 4 22:03:41 2012 Return-Path: Delivered-To: freebsd-numerics@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E7F9F106566C for ; Sat, 4 Aug 2012 22:03:41 +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 AEA3C8FC08 for ; Sat, 4 Aug 2012 22:03:41 +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 q74M3YDA017807; Sat, 4 Aug 2012 17:03:35 -0500 (CDT) (envelope-from stephen@missouri.edu) Message-ID: <501D9C36.2040207@missouri.edu> Date: Sat, 04 Aug 2012 17:03:34 -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: Bruce Evans References: <5017111E.6060003@missouri.edu> <501C361D.4010807@missouri.edu> <20120804165555.X1231@besplex.bde.org> <501D51D7.1020101@missouri.edu> <20120805030609.R3101@besplex.bde.org> In-Reply-To: <20120805030609.R3101@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-numerics@freebsd.org Subject: Re: Complex arg-trig functions 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, 04 Aug 2012 22:03:42 -0000 On 08/04/2012 03:45 PM, Bruce Evans wrote: > On Sat, 4 Aug 2012, Stephen Montgomery-Smith wrote: > >> On 08/04/2012 03:49 AM, Bruce Evans wrote: >>> On Fri, 3 Aug 2012, Stephen Montgomery-Smith wrote: >> >>> I made good progress with clog[fl](). The accuracy problems near 0 >>> are long solved and proved to be solved. >> >> I would be interested to see how you solved this. Would you be >> willing to post your code somewhere? I am starting to go through your code. What is the purpose of the macros norm and spadd? Also, the proof you provided (which I haven't gone through in detail yet) - do you intend to put them as comments in the code? For example, when you write: % EXTRACT_WORDS(hx, lx, ax); % bits = ((uint64_t)hx << 32) | lx; % bits += 0x04000000; % hx = bits >> 32; % lx = bits & 0xf8000000; % INSERT_WORDS(xh, hx, lx); % xl = ax - xh; it would be very helpful to include a comment like % /* * xh is ax rounded to nearest 26 bit floating point. * xl is such that x = xh + xl. * Because xh is rounded and not truncated to 26 bits, * only the top 26 bits (not 27=53-26) of the mantissa of * xl can be non-zero. */ because while that can be deduced from reading the code, it is by no means obvious. By the way, that rounding to the nearest 26 bits is a very smart idea.