about summary refs log tree commit diff
path: root/math/multc3.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-10-08 10:18:26 -0400
committerUlrich Drepper <drepper@gmail.com>2011-10-08 10:18:26 -0400
commit7edb55ce06ab1fa716a062cd1cb6682585bb449d (patch)
tree3fed82e7c3f86ac57f3e9d6f314044b7dbdb8d03 /math/multc3.c
parent187da0aedcd9d0a2fb34477bef41549681ba1273 (diff)
downloadglibc-7edb55ce06ab1fa716a062cd1cb6682585bb449d.tar.gz
glibc-7edb55ce06ab1fa716a062cd1cb6682585bb449d.tar.xz
glibc-7edb55ce06ab1fa716a062cd1cb6682585bb449d.zip
Optimize use of isnan, isinf, finite
Diffstat (limited to 'math/multc3.c')
-rw-r--r--math/multc3.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/math/multc3.c b/math/multc3.c
index 6369f48f24..351dccf807 100644
--- a/math/multc3.c
+++ b/math/multc3.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson <rth@redhat.com>, 2005.
 
@@ -39,28 +39,29 @@ __multc3 (long double a, long double b, long double c, long double d)
     {
       /* Recover infinities that computed as NaN + iNaN.  */
       bool recalc = 0;
-      if (isinf (a) || isinf (b))
+      if (__isinf_nsl (a) || __isinf_nsl (b))
 	{
 	  /* z is infinite.  "Box" the infinity and change NaNs in
 	     the other factor to 0.  */
-	  a = __copysignl (isinf (a) ? 1 : 0, a);
-	  b = __copysignl (isinf (b) ? 1 : 0, b);
+	  a = __copysignl (__isinf_nsl (a) ? 1 : 0, a);
+	  b = __copysignl (__isinf_nsl (b) ? 1 : 0, b);
 	  if (isnan (c)) c = __copysignl (0, c);
 	  if (isnan (d)) d = __copysignl (0, d);
 	  recalc = 1;
 	}
-     if (isinf (c) || isinf (d))
+     if (__isinf_nsl (c) || __isinf_nsl (d))
 	{
 	  /* w is infinite.  "Box" the infinity and change NaNs in
 	     the other factor to 0.  */
-	  c = __copysignl (isinf (c) ? 1 : 0, c);
-	  d = __copysignl (isinf (d) ? 1 : 0, d);
+	  c = __copysignl (__isinf_nsl (c) ? 1 : 0, c);
+	  d = __copysignl (__isinf_nsl (d) ? 1 : 0, d);
 	  if (isnan (a)) a = __copysignl (0, a);
 	  if (isnan (b)) b = __copysignl (0, b);
 	  recalc = 1;
 	}
      if (!recalc
-	  && (isinf (ac) || isinf (bd) || isinf (ad) || isinf (bc)))
+	  && (__isinf_nsl (ac) || __isinf_nsl (bd)
+	      || __isinf_nsl (ad) || __isinf_nsl (bc)))
 	{
 	  /* Recover infinities from overflow by changing NaNs to 0.  */
 	  if (isnan (a)) a = __copysignl (0, a);