Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Sep 2012 16:12:40 -0500
From:      Stephen Montgomery-Smith <stephen@missouri.edu>
To:        freebsd-numerics@freebsd.org
Subject:   Re: Complex arg-trig functions
Message-ID:  <505E29C8.6030305@missouri.edu>
In-Reply-To: <505E27CE.3060107@missouri.edu>
References:  <5017111E.6060003@missouri.edu> <20120916134730.Y957@besplex.bde.org> <5055ECA8.2080008@missouri.edu> <20120917022614.R2943@besplex.bde.org> <50562213.9020400@missouri.edu> <20120917060116.G3825@besplex.bde.org> <50563C57.60806@missouri.edu> <20120918012459.V5094@besplex.bde.org> <5057A932.3000603@missouri.edu> <5057F24B.7020605@missouri.edu> <20120918162105.U991@besplex.bde.org> <20120918232850.N2144@besplex.bde.org> <20120919010613.T2493@besplex.bde.org> <505BD9B4.8020801@missouri.edu> <20120921172402.W945@besplex.bde.org> <20120921212525.W1732@besplex.bde.org> <505C7490.90600@missouri.edu> <20120922042112.E3044@besplex.bde.org> <505CBF14.70908@missouri.edu> <505CC11A.5030502@missouri.edu> <20120922081607.F3613@besplex.bde.org> <20120922091625.Y3828@besplex.b! de.org> <505D1037.8010202@missouri.edu> <20120922142349.X4599@besplex.bde.org> <20120923044814.S1465@besplex.bde.org> <505E2575.6030302@missouri.edu> <505E27CE.3060107@missouri.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Here is a little cleaning in the code.

	/* To ensure the same accuracy as atan(), and to filter out z = 0. */
	if (x == 0)
		return (cpack(x, atan(y)));

	if (isnan(x) || isnan(y)) {
		/* catanh(+-Inf + I*NaN) = +-0 + I*NaN */
		if (isinf(x))
			return (cpack(copysign(0, x), y+y));
		/* catanh(NaN + I*+-Inf) = sign(NaN)0 + I*+-PI/2 */
		if (isinf(y))
			return (cpack(copysign(0, x), copysign(pio2_hi + pio2_lo, y)));
-		/* catanh(+-0 + I*NaN) = +-0 + I*NaN */
-		if (x == 0)
-			return (cpack(x, y+y));





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?505E29C8.6030305>