From owner-freebsd-numerics@FreeBSD.ORG Sun Aug 12 23:13: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 18F6F106566B for ; Sun, 12 Aug 2012 23:13:10 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vps.rulingia.com (host-122-100-2-194.octopus.com.au [122.100.2.194]) by mx1.freebsd.org (Postfix) with ESMTP id A8EF88FC15 for ; Sun, 12 Aug 2012 23:13:09 +0000 (UTC) Received: from server.rulingia.com (c220-239-249-137.belrs5.nsw.optusnet.com.au [220.239.249.137]) by vps.rulingia.com (8.14.5/8.14.5) with ESMTP id q7CND9it075948 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 13 Aug 2012 09:13:09 +1000 (EST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.14.5/8.14.5) with ESMTP id q7CND2RV021880 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 13 Aug 2012 09:13:03 +1000 (EST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.14.5/8.14.5/Submit) id q7CND2gf021879 for freebsd-numerics@freebsd.org; Mon, 13 Aug 2012 09:13:02 +1000 (EST) (envelope-from peter) Resent-From: Peter Jeremy Resent-Date: Mon, 13 Aug 2012 09:13:02 +1000 Resent-Message-ID: <20120812231302.GY20453@server.rulingia.com> Resent-To: freebsd-numerics@freebsd.org Received: from vps.rulingia.com (host-122-100-2-194.octopus.com.au [122.100.2.194]) by server.rulingia.com (8.14.5/8.14.5) with ESMTP id q6L5Vq1d064426 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 21 Jul 2012 15:31:52 +1000 (EST) (envelope-from stephen@missouri.edu) Received: from wilberforce.math.missouri.edu (wilberforce.math.missouri.edu [128.206.184.213]) by vps.rulingia.com (8.14.5/8.14.5) with ESMTP id q6L5Vnxp095671 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 21 Jul 2012 15:31:52 +1000 (EST) (envelope-from stephen@missouri.edu) 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 q6L5VTZr021090; Sat, 21 Jul 2012 00:31:30 -0500 (CDT) (envelope-from stephen@missouri.edu) Message-ID: <500A3EB1.9040806@missouri.edu> From: Stephen Montgomery-Smith Mail-Followup-To: freebsd-numerics@freebsd.org User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Peter Jeremy References: <20120719205347.T2601@besplex.bde.org> <50084322.7020401@missouri.edu> <20120720035001.W4053@besplex.bde.org> <50085441.4090305@missouri.edu> <20120720162953.N2162@besplex.bde.org> <20120720184114.B2790@besplex.bde.org> <50097128.6030405@missouri.edu> <20120721032448.X5744@besplex.bde.org> <500A0DCF.4030707@missouri.edu> <500A139D.2090803@missouri.edu> <20120721043052.GB73662@server.rulingia.com> In-Reply-To: <20120721043052.GB73662@server.rulingia.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Diane Bruce , Bruce Evans , John Baldwin , David Chisnall , Bruce Evans , Steve Kargl , David Schultz , Warner Losh Subject: Re: Use of C99 extra long double math functions after r236148 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: , Date: Sun, 12 Aug 2012 23:13:10 -0000 X-Original-Date: Sat, 21 Jul 2012 00:31:29 -0500 X-List-Received-Date: Sun, 12 Aug 2012 23:13:10 -0000 On 07/20/2012 11:30 PM, Peter Jeremy wrote: > On 2012-Jul-20 21:27:41 -0500, Stephen Montgomery-Smith wrote: >> The way they handle the real part of clog(z), log(hypot(x,y)), when >> hypot(x,y) is close to 1, is to do the calculation in double precision. >> So to do it properly, we need a double double precision arithmetic, >> which we don't have. > > Actually, we do. r230363 includes both extended and quad long-double > emulation code in lib/libc/softfloat. There's also ld128 code under > lib/libc/sparc64/fpu. Does the double-double precision arithmetic include sqrt? If that is the case, I might be able to make short work of casinh. Looking at the Hull paper, one hard part is computing hypot(x-1,y) + hypot(x+1,y) - 2 that is |z-1| + |z+1| - 2 to great accuracy. And after thinking about it for a while, you realize that when z is close to the interval [-1,1], getting this calculation done with any accuracy is really hard. I think if I could do this calculation in double-double precision, then I would get all the accuracy I need.