123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- #include "math.h"
- #include "math_private.h"
- static const double one = 1.0, shuge = 1.0e307;
- double __ieee754_sinh(double x)
- {
- double t,w,h;
- int32_t ix,jx;
- u_int32_t lx;
-
- GET_HIGH_WORD(jx,x);
- ix = jx&0x7fffffff;
-
- if(ix>=0x7ff00000) return x+x;
- h = 0.5;
- if (jx<0) h = -h;
-
- if (ix < 0x40360000) {
- if (ix<0x3e300000)
- if(shuge+x>one) return x;
- t = expm1(fabs(x));
- if(ix<0x3ff00000) return h*(2.0*t-t*t/(t+one));
- return h*(t+t/(t+one));
- }
-
- if (ix < 0x40862E42) return h*__ieee754_exp(fabs(x));
-
- GET_LOW_WORD(lx,x);
- if (ix<0x408633CE || ((ix==0x408633ce)&&(lx<=(u_int32_t)0x8fb9f87d))) {
- w = __ieee754_exp(0.5*fabs(x));
- t = h*w;
- return t*w;
- }
-
- return x*shuge;
- }
|