summaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/flt-32/e_hypotf.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix hypot sNaN handling (bug 20940).Joseph Myers2016-12-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TS 18661-1 generally defines libm functions taking sNaN arguments to return qNaN and raise "invalid", even for the cases where a corresponding qNaN argument would not result in a qNaN return. This includes hypot with one argument being an infinity and the other being an sNaN. This patch duly fixes hypot implementatations in glibc (generic and powerpc) to ensure qNaN, computed by arithmetic on the arguments, is returned in that case. Various implementations do their checks for infinities and NaNs inline by manipulating the representations of the arguments. For simplicity, this patch just uses issignaling to check for sNaN arguments. This could be inlined like the existing code (with due care about reversed quiet NaN conventions, for implementations where that is relevant), but given that all these checks are in cases where it's already known at least one argument is not finite, which should be the uncommon case, that doesn't seem worthwhile unless performance issues are observed in practice. Tested for x86_64, x86, mips64 and powerpc. [BZ #20940] * sysdeps/ieee754/dbl-64/e_hypot.c (__ieee754_hypot): Do not return Inf for arguments Inf and sNaN. * sysdeps/ieee754/flt-32/e_hypotf.c (__ieee754_hypotf): Likewise. * sysdeps/ieee754/ldbl-128/e_hypotl.c (__ieee754_hypotl): Likewise. * sysdeps/ieee754/ldbl-128ibm/e_hypotl.c (__ieee754_hypotl): Likewise. * sysdeps/ieee754/ldbl-96/e_hypotl.c (__ieee754_hypotl): Likewise. * sysdeps/powerpc/fpu/e_hypot.c (TEST_INF_NAN): Do not return Inf for arguments Inf and sNaN. When returning a NaN, compute it by arithmetic on the arguments. * sysdeps/powerpc/fpu/e_hypotf.c (TEST_INF_NAN): Likewise. * math/libm-test.inc (pow_test_data): Add tests of sNaN arguments.
* Simplify hypotf infinity handling (bug 15918).Joseph Myers2015-09-151-10/+2
| | | | | | | | | | | | | | Bug 15918 points out that the handling of infinities in hypotf can be simplified: it's enough to return the absolute value of the infinite argument without first comparing it to the other argument and possibly returning that other argument's absolute value. This patch makes that cleanup (which should not change how hypotf behaves on any input). Tested for x86_64. [BZ #15918] * sysdeps/ieee754/flt-32/e_hypotf.c (__ieee754_hypotf): Simplify handling of cases where one argument is an infinity.
* Fix hypotf overflow/underflow by using double precision instead of scaling.David S. Miller2012-03-131-52/+25
| | | | | | [BZ #13840] * sysdeps/ieee754/flt-32/e_hypotf.c (__ieee754_hypotf): Rewrite to use double-precision for the calculation instead of scaling.
* Use <> for math.h and math_private.h everywhere.Richard Henderson2012-03-091-2/+2
| | | | Entire tree edited via find | grep | sed.
* Optimize libmUlrich Drepper2011-10-121-14/+7
| | | | | libm is now somewhat integrated with gcc's -ffinite-math-only option and lots of the wrapper functions have been optimized.
* * sysdeps/ieee754/flt-32/e_hypotf.c (__ieee754_hypotf): Remove theUlrich Drepper2005-09-061-3/+3
| | | | exponent bias from the increment value for scaling by 2^60.
* * sysdeps/ieee754/flt-32/e_hypotf.c [!__STDC__]: Fix function name.Ulrich Drepper2005-08-301-2/+2
| | | | | | | | | | | | | | | 2005-08-01 Bob Wilson <bob.wilson@acm.org> Richard Sandiford <richard@codesourcery.com> * sysdeps/ieee754/flt-32/e_hypotf.c (__ieee754_hypotf): Add missing exponent bias to the value for 2^126. 2005-08-30 Jakub Jelinek <jakub@redhat.com> Alan Modra <amodra@bigpond.net.au> * elf/dl-addr.c (_dl_addr): Use DL_ADDR_SYM_MATCH macro. * sysdeps/generic/ldsodefs.h (DL_ADDR_SYM_MATCH): Define. * sysdeps/unix/sysv/linux/powerpc/powerpc64/ldsodefs.h: New file.
* (CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.Ulrich Drepper2004-12-221-5/+5
|
* 2.5-18.1Jakub Jelinek2007-07-121-5/+5
|
* Update.Ulrich Drepper1999-07-141-0/+87