From owner-freebsd-numerics@FreeBSD.ORG Sun Aug 12 23:04:08 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 03241106566C for ; Sun, 12 Aug 2012 23:04:08 +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 63F2D8FC0C for ; Sun, 12 Aug 2012 23:04:07 +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 q7CN4702075652 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 13 Aug 2012 09:04:07 +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 q7CN3x4O021217 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 13 Aug 2012 09:04:00 +1000 (EST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.14.5/8.14.5/Submit) id q7CN3xbr021216 for freebsd-numerics@freebsd.org; Mon, 13 Aug 2012 09:03:59 +1000 (EST) (envelope-from peter) Resent-From: Peter Jeremy Resent-Date: Mon, 13 Aug 2012 09:03:59 +1000 Resent-Message-ID: <20120812230359.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 q6RN5QU8016982 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 28 Jul 2012 09:05:26 +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 q6RN5OPD061602 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 28 Jul 2012 09:05:26 +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 q6RN5114001170; Fri, 27 Jul 2012 18:05:02 -0500 (CDT) (envelope-from stephen@missouri.edu) Message-ID: <50131E9D.6030603@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: <20120717225328.GA86902@server.rulingia.com> <20120717232740.GA95026@troutmask.apl.washington.edu> <20120718001337.GA87817@server.rulingia.com> <20120718123627.D1575@besplex.bde.org> <20120722121219.GC73662@server.rulingia.com> <500DAD41.5030104@missouri.edu> <20120724113214.G934@besplex.bde.org> <501204AD.30605@missouri.edu> <20120727032611.GB25690@server.rulingia.com> <20120727155521.E4712@besplex.bde.org> <20120727210559.GF31169@server.rulingia.com> In-Reply-To: <20120727210559.GF31169@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:04:08 -0000 X-Original-Date: Fri, 27 Jul 2012 18:05:01 -0500 X-List-Received-Date: Sun, 12 Aug 2012 23:04:08 -0000 Bruce and I have continued a discussion at http://www.freebsd.org/cgi/query-pr.cgi?pr=170206. I sure wish we could have a mailing list like freebsd-numerics to have these discussions. Then we could do things like change the subject line, so that we didn't have to follow everything. The idea of when you add a bunch of numbers that you start with the smallest first - I can see that being effective when all the numbers have the same signs. But I can also see it being quite disastrous when the numbers have different signs. I am trying to avoid "catastrophic loss of relative error" whereas you guys all seem to be after that last little bit of ULP. I guess it is a different mind set. If you are adding four numbers that are all positive, and you fail to add them from smallest to largest, the worst you will get is to increase your ULP to something like 4. But if you have numbers of different signs, like -1, 1, 1e-100 you definitely want to add the numbers of largest absolute value before you add the number with smallest absolute value. If you add from smallest to largest (either in the absolute value sense, or in the signed sense), you get a relative error of infinity. That is what I mean by "catastrophic loss of relative error." I remember having this long argument with Steve about how a ULP of 10 seemed just fine to me. And for most applications, when you compute clog(z), and |z| is close to 1, but z is not close to one, almost always you are not going to know the real and imaginary part of z exactly (it will be the result of some other computation), and so the huge relative error in computing clog(z) will represent a true lack of knowledge, not some artifact of the computational method. Indeed, that is why, even if I could compute clog(z) perfectly, I would never use clog to compute casinh(z) using the formula clog(z+csqrt(z*z+1)). This is because I also wouldn't have a good bound on |z+sqrt(z*z+1)|-1. All this talk about not wanting to be on the wrong part of the Riemann surface just seems like you are living in dream land. You could always come up with some kind of difficult analytic function for which near perfect resolution is going to be made difficult. For example, catanh(z) - I*PI/4 will never be calculable with good accuracy for |z| close to 1, unless you write a very special function for it.