Use of C99 extra long double math functions after r236148
Stephen Montgomery-Smith
stephen at missouri.edu
Sun Aug 12 23:13:10 UTC 2012
On 07/20/2012 11:30 PM, Peter Jeremy wrote:
> On 2012-Jul-20 21:27:41 -0500, Stephen Montgomery-Smith <stephen at missouri.edu> wrote:
>> The way they handle the real part of clog(z), log(hypot(x,y)), when
>> hypot(x,y) is close to 1, is to do the calculation in double precision.
>> So to do it properly, we need a double double precision arithmetic,
>> which we don't have.
>
> Actually, we do. r230363 includes both extended and quad long-double
> emulation code in lib/libc/softfloat. There's also ld128 code under
> lib/libc/sparc64/fpu.
Does the double-double precision arithmetic include sqrt? If that is
the case, I might be able to make short work of casinh. Looking at the
Hull paper, one hard part is computing
hypot(x-1,y) + hypot(x+1,y) - 2
that is
|z-1| + |z+1| - 2
to great accuracy. And after thinking about it for a while, you realize
that when z is close to the interval [-1,1], getting this calculation
done with any accuracy is really hard.
I think if I could do this calculation in double-double precision, then
I would get all the accuracy I need.
More information about the freebsd-numerics
mailing list