]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/ieee754/ldbl-128/e_coshl.c
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / sysdeps / ieee754 / ldbl-128 / e_coshl.c
index c40c850f1c8eb389fc91f87edfe0059403c07c84..2b8c1abfc26ec88925a5885bce11a1393164e9cf 100644 (file)
@@ -28,7 +28,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_coshl(x)
  * Method :
  *      only coshl(0)=1 is exact for finite x.
  */
 
-#include "math.h"
-#include "math_private.h"
+#include <math.h>
+#include <math_private.h>
 
-static const long double one = 1.0, half = 0.5, huge = 1.0e4900L,
-ovf_thresh = 1.1357216553474703894801348310092223067821E4L;
+static const _Float128 one = 1.0, half = 0.5, huge = L(1.0e4900),
+ovf_thresh = L(1.1357216553474703894801348310092223067821E4);
 
-long double
-__ieee754_coshl (long double x)
+_Float128
+__ieee754_coshl (_Float128 x)
 {
-  long double t, w;
+  _Float128 t, w;
   int32_t ex;
   ieee854_long_double_shape_type u;
 
@@ -77,10 +77,10 @@ __ieee754_coshl (long double x)
   /* |x| in [0,0.5*ln2], return 1+expm1l(|x|)^2/(2*expl(|x|)) */
   if (ex < 0x3ffd62e4) /* 0.3465728759765625 */
     {
+      if (ex < 0x3fb80000) /* |x| < 2^-116 */
+       return one;             /* cosh(tiny) = 1 */
       t = __expm1l (u.value);
       w = one + t;
-      if (ex < 0x3fb80000) /* |x| < 2^-116 */
-       return w;               /* cosh(tiny) = 1 */
 
       return one + (t * t) / (w + w);
     }