]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - math/s_csinh_template.c
Fix f64xdivf128, f64xmulf128 spurious underflows (bug 28358)
[thirdparty/glibc.git] / math / s_csinh_template.c
index 45fbb36fd9feccd3a785377c2bbcca1d7082d16c..679e76b1340a2befab80b15364538ad54f47d1e3 100644 (file)
@@ -1,7 +1,6 @@
 /* Complex sine hyperbole function for float types.
-   Copyright (C) 1997-2016 Free Software Foundation, Inc.
+   Copyright (C) 1997-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://www.gnu.org/licenses/>.  */
 
 #include <complex.h>
 #include <fenv.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-underflow.h>
 #include <float.h>
 
 CFLOAT
@@ -97,10 +97,7 @@ M_DECL_FUNC (__csinh) (CFLOAT x)
            {
              /* Real part is 0.0.  */
              __real__ retval = M_COPYSIGN (0, negate ? -1 : 1);
-             __imag__ retval = M_NAN;
-
-             if (icls == FP_INFINITE)
-               feraiseexcept (FE_INVALID);
+             __imag__ retval = __imag__ x - __imag__ x;
            }
          else
            {
@@ -144,10 +141,7 @@ M_DECL_FUNC (__csinh) (CFLOAT x)
       else
        {
          __real__ retval = M_HUGE_VAL;
-         __imag__ retval = M_NAN;
-
-         if (icls == FP_INFINITE)
-           feraiseexcept (FE_INVALID);
+         __imag__ retval = __imag__ x - __imag__ x;
        }
     }
   else
@@ -160,7 +154,3 @@ M_DECL_FUNC (__csinh) (CFLOAT x)
 }
 
 declare_mgen_alias (__csinh, csinh)
-
-#if M_LIBM_NEED_COMPAT (csinh)
-declare_mgen_libm_compat (__csinh, csinh)
-#endif