Fix casinh, casin overflow (bug 14996)
Andreas Jaeger
aj@suse.com
Sun Jan 6 19:21:00 GMT 2013
On 01/05/2013 01:33 AM, Joseph S. Myers wrote:
> Bug 14996 is spurious overflow of casinh (and so of casin) for large
> arguments, when the internal squaring of the argument overflows.
>
> In the calculation of z + sqrt (1 + z*z), for z in the first quadrant,
> 1 + z*z differs negligibly from z*z (in both modulus and argument) and
> so the value (of which the log is taken) differs negligibly from 2*z,
> if the modulus of z*z is of the order of 1/epsilon or larger. In this
> patch, 1/epsilon is actually used as a threshold on the real and
> imaginary parts of z to choose a simpler calculation, since the
> epsilon value is conveniently available as a constant whereas
> sqrt(epsilon), approximately the least threshold that could be used,
> isn't. (Any value whose order of magnitude is between sqrt(epsilon)
> and sqrt(max representable value) would be a suitable threshold,
> though values close to either end of that range would need more
> careful consideration of what exactly the bounds are.)
>
> Tested x86_64 and x86 and ulps updated accordingly.
Thanks, this is fine,
Andreas
--
Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
More information about the Libc-alpha
mailing list