Complex arg-trig functions
Stephen Montgomery-Smith
stephen at missouri.edu
Sun Sep 9 23:42:09 UTC 2012
On 09/06/2012 06:42 AM, Bruce Evans wrote:
> I'm back from a holiday.
>
> On Sun, 26 Aug 2012, Stephen Montgomery-Smith wrote:
> I tested your latest version and found regressions for NaNs. (Also,
> the float version is less accurate now that it doesn't call double
> functions, but that is a progression.)
> 1. casin*() abuses x and y for |x| and |y| and thus loses the sign of
> NaNs. The quick fix is to reload the original values. The correct
> fix is to use separate variables for the absolute values, as is
> done for cacosh*() and catanh*().
I now uniformly use ax and ay for |x| and |y| throughout.
> 2. NaNs are now filtered out early
It is not correct to filter out the NaNs early. This is because of the
way expressions like cacosh(NaN + I*INF) are defined in C99. The INFs
must be filtered out first.
> % @@ -289,7 +284,16 @@
> % * the arguments is not NaN, so we opt not to raise it.
> % */
> % - return (cpack(x+y, x+y));
> % + return (cpack(x+0.0L+(y+0), x+0.0L+(y+0)));
> % }
Why does the second way work, and the first way doesn't?
More information about the freebsd-numerics
mailing list