From owner-freebsd-numerics@FreeBSD.ORG Sun Aug 12 23:10:47 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 96DB8106564A for ; Sun, 12 Aug 2012 23:10:47 +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 1BA898FC0A for ; Sun, 12 Aug 2012 23:10:46 +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 q7CNAkq5075836 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 13 Aug 2012 09:10:47 +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 q7CNAesd021655 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 13 Aug 2012 09:10:40 +1000 (EST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.14.5/8.14.5/Submit) id q7CNAeuw021654 for freebsd-numerics@freebsd.org; Mon, 13 Aug 2012 09:10:40 +1000 (EST) (envelope-from peter) Resent-From: Peter Jeremy Resent-Date: Mon, 13 Aug 2012 09:10:40 +1000 Resent-Message-ID: <20120812231040.GB20453@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 q6N4qgxI011451 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 23 Jul 2012 14:52:43 +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 q6N4qdZB010952 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 23 Jul 2012 14:52:41 +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 q6N4qCsj008623; Sun, 22 Jul 2012 23:52:12 -0500 (CDT) (envelope-from stephen@missouri.edu) Message-ID: <500CD87D.9060804@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: Bruce Evans 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> <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> <50095CDE.4050507@missouri.edu> <20120723044308.X6145@besplex.bde.org> <500C5EE5.4090602@missouri.edu> <20120723131233.U1189@besplex.bde.org> In-Reply-To: <20120723131233.U1189@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Diane Bruce , John Baldwin , David Chisnall , Bruce Evans , Steve Kargl , 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:10:47 -0000 X-Original-Date: Sun, 22 Jul 2012 23:52:13 -0500 X-List-Received-Date: Sun, 12 Aug 2012 23:10:47 -0000 On 07/22/2012 11:12 PM, Bruce Evans wrote: > On Sun, 22 Jul 2012, Stephen Montgomery-Smith wrote: > >> But I will say that your latest version of clog doesn't do as well as >> mine with this input: >> >> x = unur_sample_cont(gen); >> y = unur_sample_cont(gen); >> h = hypot(x,y); >> x = x/h; >> y = y/h; >> >> I was able to get ULPs less than 2. Your program gets ULPs more like >> up to 4000. > > I may have broken the double version when working mostly on the float > version recently. > > What are the actual x and y? I'm not set up to use mpfr. The code segment didn't I showed didn't use mpfr. It used unuran. Basically I am generating random numbers uniformly distributed on the disk |z|=1. You could also do it using x = cos(t) y = sin(t) where t is a random real number in the interval [0,2 pi]. > Since the float version gets errors of 4096 ulps (12 bits wrong), the > double version is sure to get errors of [much more than] 12 + (53-24) > = 41 bits wrong. That is 2 tera ulps. Not noticing such enormous > errors indicates that the problematic cases haven't been tested. I > think you are right that it needs more like tripled double precision > -- with merely doubled double precision, it can probably get all 53 > mantissa bits and the sign bit wrong too (sign of (|z|^2 - 1)). That > is total loss of precision (TLOSS), and should be handled by returning > NaN. Sign errors are especially interesting with complex functions > and even for real log() applied to a real function, since they may > change the branch. I got TLOSS including sign errors in the loghypotf() > result in intermediate version due to bugs in the doubling of float > precision. Before the attempted doubling, TLOSS might have been the > usual case for z near 1! I will have another go at this code, maybe tomorrow, maybe later. I have been putting a lot of work into casinh, casin, cacosh and cacos, getting the branches correct. That has exhausted me. >> I have to say that I consider a ULP of 4000 under these very extreme >> circumstances to be acceptable. Definitely acceptable if the code >> goes a whole lot faster than code that has a ULP of less than 2. > > "An ULP of 4000" is unusual terminology. An ulp is a unit, not a count. I am so different than you guys. I have no problem with lack of consistency in notation, no problem with language being abused, no problem with people using different programming styles - certainly no problems with ULP's on the large side (oops, errors with large numbers of ULP's) , and ... > I haven't figured out how to cut down the amount of mail generated by > this thread. Sorry to add to it :-). ... no problems deleting emails that I don't want (but surely with all the email volume we have, this does suggest we need a freebsd-numerics mailing list, doesn't it?), and ... > >> On 07/22/2012 02:29 PM, Bruce Evans wrote: >>> Replying again to this... > > Top posting is one way :-). ... most definitely no problem with top posting! I try not to top post on the FreeBSD mailing list because I know so many people there are bothered by it. But most of the people I communicate with (professors in academic institutions, friends and relatives) top post all the time. But I should have remembered not to top post with you guys. I understand that you guys and I think differently. I don't think that I am right and you guys are wrong. But conversely, I hope that you don't think I am wrong and you are right! And I hope that you can appreciate the qualities I bring to the discussion, just as I appreciate the qualities that you bring. Stephen