From owner-freebsd-bugs@FreeBSD.ORG Fri Jul 27 20:50:16 2012 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 385C4106564A; Fri, 27 Jul 2012 20:50:16 +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 F10C08FC08; Fri, 27 Jul 2012 20:50:15 +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 q6RKoEHQ022529; Fri, 27 Jul 2012 15:50:14 -0500 (CDT) (envelope-from stephen@missouri.edu) Message-ID: <5012FF06.4030501@missouri.edu> Date: Fri, 27 Jul 2012 15:50:14 -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: <201207270247.q6R2lkeR021134@wilberforce.math.missouri.edu> <20120727233939.A7820@besplex.bde.org> In-Reply-To: <20120727233939.A7820@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-bugs@freebsd.org, FreeBSD-gnats-submit@freebsd.org, Stephen Montgomery-Smith Subject: Re: bin/170206: complex arcsinh, log, etc. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 20:50:16 -0000 On 07/27/2012 09:26 AM, Bruce Evans wrote: > VC> > For clog, the worst case that I've found so far has x^2+y^2-1 ~= > 1e-47: > VC> > > VC> > x = > 0.999999999999999555910790149937383830547332763671875000000000 > VC> > y = > VC> > 0.0000000298023223876953091912775497878893005143652317201485857367516 > VC> > (need high precision decimal or these rounded to 53 bits > binary) > VC> > x^2+y^2-1 = 1.0947644252537633366591637369e-47 > VC> VC> That is exactly 2^(-156). So maybe triple quad precision really > is enough. Furthermore, if you use the computation (x-1)*(x+1)*y*y (assuming as you do x>y>0), only double precision is necessary. This is proved in the paper "Implementing Complex Elementary Functions Using Exception Handling" by Hull, Fairgrieve, Tang, ACM Transactions on Mathematical Software, Vol 20, No 2, 1994. They give a bound on the error, which I think can be interpreted as being around 3.9 ULP. And I think you will see that your example does not contradict their theorem. Because in your example, x-1 will be rather small. So to get reasonable ULP (reasonable meaning 4 rather than 1), double precision is all you need.