fix regression from a745c4bfc8a9b5db4e48387170da0dc1d39e3abe
[uclibc-ng.git] / libm / w_coshf.c
blob940d77876ef834f0cda2ac4a3352be90acbc521f
1 /* w_coshf.c -- float version of w_cosh.c.
2 * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
3 * Optimizations by Ulrich Drepper <drepper@gmail.com>, 2011.
4 */
6 /*
7 * ====================================================
8 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
10 * Developed at SunPro, a Sun Microsystems, Inc. business.
11 * Permission to use, copy, modify, and distribute this
12 * software is freely granted, provided that this notice
13 * is preserved.
14 * ====================================================
18 * wrapper coshf(x)
21 #include <math.h>
22 #include "math_private.h"
24 float
25 coshf (float x)
27 #if __UCLIBC_HAS_FENV__
28 float z = (float) __ieee754_cosh ((double) x);
29 if (__builtin_expect (!isfinite (z), 0) && isfinite (x)
30 && _LIB_VERSION != _IEEE_)
31 return __kernel_standard_f (x, x, 105); /* cosh overflow */
33 return z;
34 #else
35 return (float) __ieee754_cosh ((double) x);
36 #endif