]> sourceware.org Git - glibc.git/commitdiff
ldbl-128: Fix y0 and y1 for -Inf input [BZ #21130]
authorGabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Fri, 6 Jan 2017 15:05:30 +0000 (13:05 -0200)
committerGabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Sun, 12 Feb 2017 20:30:38 +0000 (18:30 -0200)
The Bessel functions of the second type (Yn) are not defined for
negative input and should return NAN with the "invalid" exception
raised, in these cases.  However, current code checks for infinity and
return zero, regardless of the sign.  This error is exposed for long
double when linking with -lieee.  Without this flag, the error is not
exposed, because the wrappers for these functions, which use
__kernel_standard functionality, return the correct value.

Tested for powerpc64le.

[BZ #21130]
* sysdeps/ieee754/ldbl-128/e_j0l.c (__ieee754_y0l): Return NAN
with the "invalid" exception raised when x is -Inf.
* sysdeps/ieee754/ldbl-128/e_j1l.c (__ieee754_y1l): Likewise.

ChangeLog
sysdeps/ieee754/ldbl-128/e_j0l.c
sysdeps/ieee754/ldbl-128/e_j1l.c

index fac0e11c40b4c9042187cbc34244a0d91b90621d..27f41f7ad043c28a5a46a233795d6e65c3fc5b45 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-02-12  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
+
+       [BZ #21130]
+       * sysdeps/ieee754/ldbl-128/e_j0l.c (__ieee754_y0l): Return NAN
+       with the "invalid" exception raised when x is -Inf.
+       * sysdeps/ieee754/ldbl-128/e_j1l.c (__ieee754_y1l): Likewise.
+
 2017-02-10  Wilco Dijkstra  <wdijkstr@arm.com>
 
        * string/bits/string2.h (strchr): Remove define.
index d711007136885e3bc3e5a44e9eb3fc6c6b659f28..855b5a578ba7b88aa7abd0a8914c591ebaa5de09 100644 (file)
@@ -829,12 +829,7 @@ _Float128
   _Float128 xx, xinv, z, p, q, c, s, cc, ss;
 
   if (! isfinite (x))
-    {
-      if (x != x)
-       return x + x;
-      else
-       return 0;
-    }
+    return 1 / (x + x * x);
   if (x <= 0)
     {
       if (x < 0)
index 9e782305d9d18ce00616309493f85c83907be753..db8dca0ab13e6747903b3d039e1e926e85fbe71c 100644 (file)
@@ -847,12 +847,7 @@ __ieee754_y1l (_Float128 x)
   _Float128 xx, xinv, z, p, q, c, s, cc, ss;
 
   if (! isfinite (x))
-    {
-      if (x != x)
-       return x + x;
-      else
-       return 0;
-    }
+    return 1 / (x + x * x);
   if (x <= 0)
     {
       if (x < 0)
This page took 0.167512 seconds and 5 git commands to generate.