From owner-freebsd-bugs@FreeBSD.ORG Fri Jul 27 21:00:20 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 51416106566B for ; Fri, 27 Jul 2012 21:00:20 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3BF6A8FC08 for ; Fri, 27 Jul 2012 21:00:20 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q6RL0KOa005635 for ; Fri, 27 Jul 2012 21:00:20 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q6RL0Kio005634; Fri, 27 Jul 2012 21:00:20 GMT (envelope-from gnats) Date: Fri, 27 Jul 2012 21:00:20 GMT Message-Id: <201207272100.q6RL0Kio005634@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Stephen Montgomery-Smith Cc: Subject: Re: bin/170206: complex arcsinh, log, etc. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Stephen Montgomery-Smith List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 21:00:20 -0000 The following reply was made to PR bin/170206; it has been noted by GNATS. From: Stephen Montgomery-Smith To: Bruce Evans Cc: Stephen Montgomery-Smith , FreeBSD-gnats-submit@freebsd.org, freebsd-bugs@freebsd.org Subject: Re: bin/170206: complex arcsinh, log, etc. Date: Fri, 27 Jul 2012 15:50:14 -0500 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.