]> git.ipfire.org Git - thirdparty/glibc.git/blame - math/w_coshf.c
Optimize libm
[thirdparty/glibc.git] / math / w_coshf.c
CommitLineData
f7eac6eb
RM
1/* w_coshf.c -- float version of w_cosh.c.
2 * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
0ac5ae23 3 * Optimizations by Ulrich Drepper <drepper@gmail.com>, 2011.
f7eac6eb
RM
4 */
5
6/*
7 * ====================================================
8 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
9 *
10 * Developed at SunPro, a Sun Microsystems, Inc. business.
11 * Permission to use, copy, modify, and distribute this
0ac5ae23 12 * software is freely granted, provided that this notice
f7eac6eb
RM
13 * is preserved.
14 * ====================================================
15 */
16
0ac5ae23 17/*
f7eac6eb
RM
18 * wrapper coshf(x)
19 */
20
9d13fb24 21#include <math.h>
9277c064 22#include <math_private.h>
f7eac6eb 23
0ac5ae23
UD
24float
25__coshf (float x)
f7eac6eb 26{
0ac5ae23
UD
27 float z = __ieee754_coshf (x);
28 if (__builtin_expect (!__finitef (z), 0) && __finitef (x)
29 && _LIB_VERSION != _IEEE_)
30 return __kernel_standard_f (x, x, 105); /* cosh overflow */
31
32 return z;
f7eac6eb
RM
33}
34weak_alias (__coshf, coshf)