Use of C99 extra long double math functions after r236148

Peter Jeremy peter at rulingia.com
Sun Aug 12 23:13:03 UTC 2012


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.

>The paper says that simulating double precision arithmetic using single 
>arithmetic is slow, so I would think the same is true for quad-precision.

It depends how much af the arithmetic needs to be in more-than-double
precision.  Possibly, careful choice of partitioning would allow double
precision to be used for most values with multi-precision only needed
some of the time.

I expect catanh() will run into similar problems evaluating
clog((1 + z)/(1 - z)).  Something like clog1p() would help when z 
is close to 1, as will using alternative expansions.

>Does the inexact flag also raise the SIGFPE signal?

It's under program control - see feenableexcept() and fedisableexcept(),

-- 
Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-numerics/attachments/20120812/7b02900c/attachment-0001.pgp


More information about the freebsd-numerics mailing list