Use of C99 extra long double math functions after r236148

Stephen Montgomery-Smith stephen at
Sun Jul 29 22:39:37 UTC 2012

On 07/29/2012 05:27 PM, Peter Jeremy wrote:
> [For anyone not previously in on this discussion, this is part of an
> ongoing discussion that has been occurring off-list in the absence of
> a suitable list.  It is planned to archive that discussion here,
> subject to all the participants agreeing].
> On 2012-Jul-28 20:16:50 -0500, Stephen Montgomery-Smith <stephen at> wrote:
>> One thing your program doesn't check are things like:
>> real part of casinh(-0+I*x) is -0
>> imaginary part of casinh(x-I*0) is -0
>> etc, where x is finite, non-zero.  (This follows from casinh being odd
>> and conjugate invariant.)
> As it currently exists, my program solely implements the checks in
> WG14/N1256 G.6.  I hadn't considered extending that to verifying that
> purely real or imaginary inputs give purely real or imaginary outputs,
> with the appropriately signed zero.  This might be reasonable but it's
> not completely trivial to implement in general since the domains of
> the real part can be different.

Maybe this should be a different program, since its logical structure 
would be quite different.  In particular, you wouldn't be checking the 
value of the non-zero parts.

Also I forgot that the real part of casinh(0+I*x) isn't always 0.  If 
|x|>1, it is something non-zero.  And so you need to check that 
creal(casinh(0+I*x)) and creal(casinh(-0+I*x)) have opposite signs in 
this case.

> I'm less sure of the next logical
> step, which is to check things like
>    casinh(x + I*0) = asinh(x) + I*0

Does C99 mandate this?  My programs probably won't satisfy this, because 
I realized that the computation works in these cases anyway.  Of course, 
it would be easy to make it happen.

More information about the freebsd-numerics mailing list