1 /* origin: FreeBSD /usr/src/lib/msun/src/e_sinhf.c */
3 * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
6 * ====================================================
7 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
9 * Developed at SunPro, a Sun Microsystems, Inc. business.
10 * Permission to use, copy, modify, and distribute this
11 * software is freely granted, provided that this notice
13 * ====================================================
18 static const float huge = 1.0e37;
25 GET_FLOAT_WORD(jx, x);
35 /* |x| in [0,9], return sign(x)*0.5*(E+E/(E+1))) */
36 if (ix < 0x41100000) { /* |x|<9 */
37 if (ix < 0x39800000) /* |x|<2**-12 */
38 /* raise inexact, return x */
43 return h*(2.0f*t - t*t/(t+1.0f));
44 return h*(t + t/(t+1.0f));
47 /* |x| in [9, logf(maxfloat)] return 0.5*exp(|x|) */
49 return h*expf(fabsf(x));
51 /* |x| in [logf(maxfloat), overflowthresold] */
53 return h * 2.0f * __expo2f(fabsf(x)); /* h is for sign only */
55 /* |x| > overflowthresold, sinh(x) overflow */