Update contrib.
3 * Portions Copyright (c) 1993-1999 Nokia Corporation and/or its subsidiary(-ies).
8 /* @(#)e_sinh.c 5.1 93/09/24 */
10 * ====================================================
11 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
13 * Developed at SunPro, a Sun Microsystems, Inc. business.
14 * Permission to use, copy, modify, and distribute this
15 * software is freely granted, provided that this notice
17 * ====================================================
22 * mathematically sinh(x) if defined to be (exp(x)-exp(-x))/2
23 * 1. Replace x by |x| (sinh(-x) = -sinh(x)).
26 * 0 <= x <= 22 : sinh(x) := --------------, E=expm1(x)
29 * 22 <= x <= lnovft : sinh(x) := exp(x)/2
30 * lnovft <= x <= ln2ovft: sinh(x) := exp(x/2)/2 * exp(x/2)
31 * ln2ovft < x : sinh(x) := x*shuge (overflow)
34 * sinh(x) is |x| if x is +INF, -INF, or NaN.
35 * only sinh(0)=0 is exact for finite x.
40 static const double one = 1.0, shuge = 1.0e307;
42 EXPORT_C double __ieee754_sinh(double x) __SOFTFP
48 /* High word of |x|. */
53 if(ix>=0x7ff00000) return x+x;
57 /* |x| in [0,22], return sign(x)*0.5*(E+E/(E+1))) */
58 if (ix < 0x40360000) { /* |x|<22 */
59 if (ix<0x3e300000) /* |x|<2**-28 */
60 if(shuge+x>one) return x;/* sinh(tiny) = tiny with inexact */
62 if(ix<0x3ff00000) return h*(2.0*t-t*t/(t+one));
63 return h*(t+t/(t+one));
66 /* |x| in [22, log(maxdouble)] return 0.5*exp(|x|) */
67 if (ix < 0x40862E42) return h*__ieee754_exp(fabs(x));
69 /* |x| in [log(maxdouble), overflowthresold] */
71 if (ix<0x408633CE || ((ix==0x408633ce)&&(lx<=(__uint32_t)0x8fb9f87d))) {
72 w = __ieee754_exp(0.5*fabs(x));
77 /* |x| > overflowthresold, sinh(x) overflow */