From owner-freebsd-bugs@FreeBSD.ORG Fri Jul 27 14:45:03 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 D8085106566B; Fri, 27 Jul 2012 14:45:03 +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 9AC998FC15; Fri, 27 Jul 2012 14:45:03 +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 q6REj2cd050481; Fri, 27 Jul 2012 09:45:03 -0500 (CDT) (envelope-from stephen@missouri.edu) Message-ID: <5012A96E.9090400@missouri.edu> Date: Fri, 27 Jul 2012 09:45:02 -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> In-Reply-To: <20120727233939.A7820@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: Fri, 27 Jul 2012 14:45:04 -0000 On 07/27/2012 09:26 AM, Bruce Evans wrote: > % hm1 = -1; > % for (i=0;i<12;i++) hm1 += val[i]; > % return (cpack(0.5 * log1p(hm1), atan2(y, x))); > > It is the trailing terms that I think don't work right here. You sort > them and add from high to low, but normally it is necessary to add > from low to high (consider terms [1, DBL_EPSILON/2, DBL_EPSILON/4]). > Adding from high to low cancels with the -1 term, but then only > particular values work right. Also, I don't see how adding the low > terms without extra precision preserves enough precision. I understand what you are saying. But in this case adding in order of smallest to largest (adding -1 last) won't work. If all the signs in the same direction, it would work. But -1 has the wrong sign. But I can also tell you that I haven't thought my algorithm through every special case. I can tell you it seems to work in all the examples I tried. But I don't have a mathematical proof.