This is the mail archive of the
`libc-alpha@sourceware.org`
mailing list for the glibc project.

Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|

Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |

Other format: | [Raw text] |

*From*: Andreas Jaeger <aj at suse dot com>*To*: libc-alpha at sourceware dot org*Date*: Sun, 06 Jan 2013 20:21:24 +0100*Subject*: Re: Fix casinh, casin overflow (bug 14996)*References*: <Pine.LNX.4.64.1301050032530.24805@digraph.polyomino.org.uk>

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

**References**:**Fix casinh, casin overflow (bug 14996)***From:*Joseph S. Myers

Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|

Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |