Date: Fri, 27 Jul 2012 14:50:07 GMT From: Stephen Montgomery-Smith <stephen@missouri.edu> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/170206: complex arcsinh, log, etc. Message-ID: <201207271450.q6REo7p0062817@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/170206; it has been noted by GNATS.
From: Stephen Montgomery-Smith <stephen@missouri.edu>
To: Bruce Evans <brde@optusnet.com.au>
Cc: Stephen Montgomery-Smith <stephen@freebsd.org>,
FreeBSD-gnats-submit@freebsd.org, freebsd-bugs@freebsd.org
Subject: Re: bin/170206: complex arcsinh, log, etc.
Date: Fri, 27 Jul 2012 09:45:02 -0500
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207271450.q6REo7p0062817>
