]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/ieee754/ldbl-128ibm/e_acosl.c
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / sysdeps / ieee754 / ldbl-128ibm / e_acosl.c
index 86639930c96b0f59a7444264e4b141df96d956ad..36fe75e21509d0306b09c736c2b28e08114d1086 100644 (file)
@@ -29,7 +29,7 @@
 
     You should have received a copy of the GNU Lesser General Public
     License along with this library; if not, see
-    <http://www.gnu.org/licenses/>.  */
+    <https://www.gnu.org/licenses/>.  */
 
 /* __ieee754_acosl(x)
  * Method :
@@ -51,7 +51,7 @@
  *      if x is NaN, return x itself;
  *      if |x|>1, return NaN with invalid signal.
  *
- * Functions needed: __ieee754_sqrtl.
+ * Functions needed: sqrtl.
  */
 
 #include <math.h>
@@ -153,6 +153,8 @@ __ieee754_acosl (long double x)
 {
   long double a, z, r, w, p, q, s, t, f2;
 
+  if (__glibc_unlikely (isnan (x)))
+    return x + x;
   a = __builtin_fabsl (x);
   if (a == 1.0L)
     {
@@ -167,7 +169,7 @@ __ieee754_acosl (long double x)
     }
   if (a < 0.5L)
     {
-      if (a < 6.938893903907228e-18L)  /* |x| < 2**-57 */
+      if (a < 0x1p-106L)
        return pio2_hi + pio2_lo;
       if (a < 0.4375L)
        {
@@ -266,7 +268,7 @@ __ieee754_acosl (long double x)
       double shi, slo;
 
       z = (one - a) * 0.5;
-      s = __ieee754_sqrtl (z);
+      s = sqrtl (z);
       /* Compute an extended precision square root from
         the Newton iteration  s -> 0.5 * (s + z / s).
         The change w from s to the improved value is