12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- #include <openlibm_math.h>
- #include "math_private.h"
- static const long double one = 1.0, shuge = 1.0e4931L;
- long double
- sinhl(long double x)
- {
- long double t,w,h;
- u_int32_t jx,ix,i0,i1;
-
- GET_LDOUBLE_WORDS(jx,i0,i1,x);
- ix = jx&0x7fff;
-
- if(ix==0x7fff) return x+x;
- h = 0.5;
- if (jx & 0x8000) h = -h;
-
- if (ix < 0x4003 || (ix == 0x4003 && i0 <= 0xc8000000)) {
- if (ix<0x3fdf)
- if(shuge+x>one) return x;
- t = expm1l(fabsl(x));
- if(ix<0x3fff) return h*(2.0*t-t*t/(t+one));
- return h*(t+t/(t+one));
- }
-
- if (ix < 0x400c || (ix == 0x400c && i0 < 0xb17217f7))
- return h*expl(fabsl(x));
-
- if (ix<0x400c || (ix == 0x400c && (i0 < 0xb174ddc0
- || (i0 == 0xb174ddc0
- && i1 <= 0x31aec0ea)))) {
- w = expl(0.5*fabsl(x));
- t = h*w;
- return t*w;
- }
-
- return x*shuge;
- }
|