From owner-freebsd-numerics@FreeBSD.ORG Sun Aug 12 23:09:20 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 24B68106566C for ; Sun, 12 Aug 2012 23:09:20 +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 B22A18FC0C for ; Sun, 12 Aug 2012 23:09:19 +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 q7CN9Jhb075779 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 13 Aug 2012 09:09:19 +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 q7CN9DXw021519 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 13 Aug 2012 09:09:13 +1000 (EST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.14.5/8.14.5/Submit) id q7CN9DlJ021518 for freebsd-numerics@freebsd.org; Mon, 13 Aug 2012 09:09:13 +1000 (EST) (envelope-from peter) Resent-From: Peter Jeremy Resent-Date: Mon, 13 Aug 2012 09:09:13 +1000 Resent-Message-ID: <20120812230913.GL20453@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 q6JBGW5W011534 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 19 Jul 2012 21:16:32 +1000 (EST) (envelope-from brde@optusnet.com.au) Received: from mail17.syd.optusnet.com.au (mail17.syd.optusnet.com.au [211.29.132.198]) by vps.rulingia.com (8.14.5/8.14.5) with ESMTP id q6JBGWZi080367 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 19 Jul 2012 21:16:32 +1000 (EST) (envelope-from brde@optusnet.com.au) Received: from c122-106-171-246.carlnfd1.nsw.optusnet.com.au (c122-106-171-246.carlnfd1.nsw.optusnet.com.au [122.106.171.246]) by mail17.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q6JBG8fE019274 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 19 Jul 2012 21:16:10 +1000 From: Bruce Evans Mail-Followup-To: freebsd-numerics@freebsd.org X-X-Sender: bde@besplex.bde.org To: Stephen Montgomery-Smith In-Reply-To: <5007AD41.9070000@missouri.edu> Message-ID: <20120719205347.T2601@besplex.bde.org> References: <20120714120432.GA70706@server.rulingia.com> <20120717084457.U3890@besplex.bde.org> <5004A5C7.1040405@missouri.edu> <5004DEA9.1050001@missouri.edu> <20120717200931.U6624@besplex.bde.org> <5006D13D.2080702@missouri.edu> <20120718205625.GA409@troutmask.apl.washington.edu> <500725F2.7060603@missouri.edu> <20120719025345.GA1376@troutmask.apl.washington.edu> <50077987.1080307@missouri.edu> <20120719032706.GA1558@troutmask.apl.washington.edu> <5007826D.7060806@missouri.edu> <5007AD41.9070000@missouri.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Mailman-Approved-At: Sun, 12 Aug 2012 23:55:59 +0000 Cc: Diane Bruce , Steve Kargl , John Baldwin , David Chisnall , Bruce Evans , Bruce Evans , David Schultz , Peter Jeremy , 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:09:20 -0000 X-Original-Date: Thu, 19 Jul 2012 21:16:08 +1000 (EST) X-List-Received-Date: Sun, 12 Aug 2012 23:09:20 -0000 On Thu, 19 Jul 2012, Stephen Montgomery-Smith wrote: > I did a ULP test on clog. The test code is attached. (Not the cleanest > code, I know, but it does the job.) It needs the mpfr and unuran ports > installed. > > To my shock, I found that under certain circumstances, the ULP in the real > part was huge. The problem is when hypot(x,y) is close to 1, because then > the real part of clog is close to zero. I was seeing ULPs in the thousands. Better than GULPs in the thousands :-). This is not the problem that I first thought it might be. > I struggled to find a solution, and now I think I have the ULP down to about > 2. I am going to work on it more tomorrow to see if I can get ULP down even > further. I peeked at the Apple code (complex.c). It is not very sophisticated, but usages log1p() and doesn't use hypot(). I don't know if this is inherently more accurate or is just more efficient. Apple code has a more sophisticated casinh() based on Kahan's old papers about branch cuts and nothing's sign bit. I don't know if Apple's copyright inibits us using complex.c. Its uglyness prevents me using it. We didn't use it for cexp() or ccosh(), and our code is better. Bruce