about summary refs log tree commit diff
path: root/math/s_cacosh_template.c
diff options
context:
space:
mode:
Diffstat (limited to 'math/s_cacosh_template.c')
-rw-r--r--math/s_cacosh_template.c50
1 files changed, 26 insertions, 24 deletions
diff --git a/math/s_cacosh_template.c b/math/s_cacosh_template.c
index 20bf2158b8..e44da39a10 100644
--- a/math/s_cacosh_template.c
+++ b/math/s_cacosh_template.c
@@ -1,4 +1,4 @@
-/* Return arc hyperbole cosine for double value.
+/* Return arc hyperbolic cosine for a complex type.
    Copyright (C) 1997-2016 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,10 +22,10 @@
 #include <math_private.h>
 
 
-__complex__ double
-__cacosh (__complex__ double x)
+CFLOAT
+M_DECL_FUNC (__cacosh) (CFLOAT x)
 {
-  __complex__ double res;
+  CFLOAT res;
   int rcls = fpclassify (__real__ x);
   int icls = fpclassify (__imag__ x);
 
@@ -33,45 +33,46 @@ __cacosh (__complex__ double x)
     {
       if (icls == FP_INFINITE)
 	{
-	  __real__ res = HUGE_VAL;
+	  __real__ res = M_HUGE_VAL;
 
 	  if (rcls == FP_NAN)
-	    __imag__ res = __nan ("");
+	    __imag__ res = M_NAN;
 	  else
-	    __imag__ res = __copysign ((rcls == FP_INFINITE
-					? (__real__ x < 0.0
-					   ? M_PI - M_PI_4 : M_PI_4)
-					: M_PI_2), __imag__ x);
+	    __imag__ res = M_COPYSIGN ((rcls == FP_INFINITE
+					? (__real__ x < 0
+					   ? M_MLIT (M_PI) - M_MLIT (M_PI_4)
+					   : M_MLIT (M_PI_4))
+					: M_MLIT (M_PI_2)), __imag__ x);
 	}
       else if (rcls == FP_INFINITE)
 	{
-	  __real__ res = HUGE_VAL;
+	  __real__ res = M_HUGE_VAL;
 
 	  if (icls >= FP_ZERO)
-	    __imag__ res = __copysign (signbit (__real__ x) ? M_PI : 0.0,
-				       __imag__ x);
+	    __imag__ res = M_COPYSIGN (signbit (__real__ x)
+				       ? M_MLIT (M_PI) : 0, __imag__ x);
 	  else
-	    __imag__ res = __nan ("");
+	    __imag__ res = M_NAN;
 	}
       else
 	{
-	  __real__ res = __nan ("");
-	  __imag__ res = __nan ("");
+	  __real__ res = M_NAN;
+	  __imag__ res = M_NAN;
 	}
     }
   else if (rcls == FP_ZERO && icls == FP_ZERO)
     {
-      __real__ res = 0.0;
-      __imag__ res = __copysign (M_PI_2, __imag__ x);
+      __real__ res = 0;
+      __imag__ res = M_COPYSIGN (M_MLIT (M_PI_2), __imag__ x);
     }
   else
     {
-      __complex__ double y;
+      CFLOAT y;
 
       __real__ y = -__imag__ x;
       __imag__ y = __real__ x;
 
-      y = __kernel_casinh (y, 1);
+      y = M_SUF (__kernel_casinh) (y, 1);
 
       if (signbit (__imag__ x))
 	{
@@ -87,8 +88,9 @@ __cacosh (__complex__ double x)
 
   return res;
 }
-weak_alias (__cacosh, cacosh)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__cacosh, __cacoshl)
-weak_alias (__cacosh, cacoshl)
+
+declare_mgen_alias (__cacosh, cacosh)
+
+#if M_LIBM_NEED_COMPAT (cacosh)
+declare_mgen_libm_compat (__cacosh, cacosh)
 #endif