Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Aug 2012 15:11:08 -0500
From:      Stephen Montgomery-Smith <stephen@missouri.edu>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        freebsd-numerics@FreeBSD.org
Subject:   Re: Complex arg-trig functions
Message-ID:  <50295F5C.6010800@missouri.edu>
In-Reply-To: <20120814003614.H3692@besplex.bde.org>
References:  <5017111E.6060003@missouri.edu> <501C361D.4010807@missouri.edu> <20120804165555.X1231@besplex.bde.org> <501D51D7.1020101@missouri.edu> <20120805030609.R3101@besplex.bde.org> <501D9C36.2040207@missouri.edu> <20120805175106.X3574@besplex.bde.org> <501EC015.3000808@missouri.edu> <20120805191954.GA50379@troutmask.apl.washington.edu> <20120807205725.GA10572@server.rulingia.com> <20120809025220.N4114@besplex.bde.org> <5027F07E.9060409@missouri.edu> <20120814003614.H3692@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 08/13/2012 11:57 AM, Bruce Evans wrote:

> @               if (sy == 0)
> @ !                 return (cpack(cimag(w), -creal(w)));
> @ !             return (cpack(-cimag(w), creal(w)));
>
> The sign of creal(cacos()) is always 1, but this makes it +- the sign
> of atan2(x, y).

Yes, but the sign of atan2(y,x) will always be the same as the sign of 
y.  So the two negatives will cancel.

But your code works just as well (and your code doesn't clobber the -0's 
in the imaginary part).

>
> @           }
> @       }
> @ --- 408,420 ----
> @ @       if (ISFINITE(bx) && ISFINITE(by) && (x >
> RECIP_SQRT_EPSILON_100 || y > RECIP_SQRT_EPSILON_100)) {
> @ !         /* XXX following can also raise overflow */


I don't see how the code could raise an overflow.  The output of clog 
should always be very much less than DBL_MAX.  (Originally I had 
clog(2*z), and that could raise an unwarranted overflow.)





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50295F5C.6010800>