Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Jul 2012 17:39:27 -0500
From:      Stephen Montgomery-Smith <stephen@missouri.edu>
To:        freebsd-numerics@FreeBSD.org
Cc:        Diane Bruce <db@db.net>, Bruce Evans <brde@optusnet.com.au>, John Baldwin <jhb@FreeBSD.org>, David Chisnall <theraven@FreeBSD.org>, Bruce Evans <bde@FreeBSD.org>, Steve Kargl <sgk@troutmask.apl.washington.edu>, David Schultz <das@FreeBSD.org>, Peter Jeremy <peter@rulingia.com>, Warner Losh <imp@bsdimp.com>
Subject:   Re: Use of C99 extra long double math functions after r236148
Message-ID:  <5015BB9F.90807@missouri.edu>
In-Reply-To: <20120729222706.GA29048@server.rulingia.com>
References:  <20120718123627.D1575@besplex.bde.org> <20120722121219.GC73662@server.rulingia.com> <500DAD41.5030104@missouri.edu> <20120724113214.G934@besplex.bde.org> <501204AD.30605@missouri.edu> <20120727032611.GB25690@server.rulingia.com> <20120728125824.GA26553@server.rulingia.com> <501460BB.30806@missouri.edu> <20120728231300.GA20741@server.rulingia.com> <50148F02.4020104@missouri.edu> <20120729222706.GA29048@server.rulingia.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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@missouri.edu> 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.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5015BB9F.90807>