From owner-freebsd-bugs@FreeBSD.ORG Sat Jul 28 15:40:46 2012 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC2A81065673; Sat, 28 Jul 2012 15:40:46 +0000 (UTC) (envelope-from stephen@missouri.edu) Received: from wilberforce.math.missouri.edu (wilberforce.math.missouri.edu [128.206.184.213]) by mx1.freebsd.org (Postfix) with ESMTP id 551008FC0C; Sat, 28 Jul 2012 15:40:46 +0000 (UTC) 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 q6SFegNv038723; Sat, 28 Jul 2012 10:40:42 -0500 (CDT) (envelope-from stephen@missouri.edu) Message-ID: <501407F9.3030200@missouri.edu> Date: Sat, 28 Jul 2012 10:40:41 -0500 From: Stephen Montgomery-Smith User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Bruce Evans References: <201207270247.q6R2lkeR021134@wilberforce.math.missouri.edu> <20120727233939.A7820@besplex.bde.org> <5012A96E.9090400@missouri.edu> <20120728142915.K909@besplex.bde.org> <50137C24.1060004@missouri.edu> <20120728171345.T1911@besplex.bde.org> In-Reply-To: <20120728171345.T1911@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-bugs@freebsd.org, FreeBSD-gnats-submit@freebsd.org, Stephen Montgomery-Smith Subject: Re: bin/170206: complex arcsinh, log, etc. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 15:40:46 -0000 On 07/28/2012 02:35 AM, Bruce Evans wrote: > On Sat, 28 Jul 2012, Stephen Montgomery-Smith wrote: > >> On 07/28/2012 12:25 AM, Bruce Evans wrote: >>> >>> #define DE DBL_EPSILON // for clarity >>> >>> (1) 1 + DE/2 = 1 (half way case rounded down to even) >>> (2) 1 + DE/2 + DE/2 = 1 (double rounding) >>> (3) DE/2 + DE/2 + 1 = 1 + DE (null rounding) >>> >>> We want to add -1 to a value near 1 like the above. Now a leading 1 >>> in the above will cancel with the -1, and the the order in (3) becomes >>> the inaccurate one. >> >> Yes, but in my situation, I am rather sure that when I am adding >> highest to lowest that this won't occur. I am starting with -1, then >> adding something close to 1, then adding lots of smaller terms. And I >> find it very plausible that the kind of situation you describe won't >> happen. x0*x0 is close to 1. x0*x1 is at most sqrt(DE) times smaller. >> And so on. So I think the kind of situation you describe should never >> happen. > > Ahem. FP^2 space is not nearly as large as the metaverse (only 2^256 > cases even for sparc64), but it is large enough so that almost > everything that can happen in it does happen in it. You are right > that problems are far away with the x* terms (x0*x0 had better not be > very close to 1 unless it is exactly 1, since it it is too close then > it will no longer be many times larger than x0*x1 after subtracting 1 > from it; the other cases for x* are simpler). The problem is with the > additional y* terms. x and y are independent, so for many or most x, > there are many y's with bits that cause half-way cases when combined > with x. > After splitting and squaring, the bits move around, so it hard to generate > or control the offending y's. > >> As I said, I don't have a mathematical proof that the kind of thing >> you describe can NEVER happen. I just have never observed it happen. > > There might be a measly 2^128 bad cases out of 2^256. Then no one would > even observe them by chance :-). But half-way cases are fairly common. I agree. That is why I am sad that I don't have a mathematical proof. and the probability of picking out the bad example by chance is something like the chances of being hit by a large asteroid, so we will never see it happen in a random experiment.