Back to index

glibc  2.9
Functions | Variables
e_sinhl.c File Reference
#include "math.h"
#include "math_private.h"

Go to the source code of this file.

Functions

long double __ieee754_sinhl (long double x)

Variables

static long double one = 1.0
static long double shuge = 1.0e307

Function Documentation

long double __ieee754_sinhl ( long double  x)

Definition at line 47 of file e_sinhl.c.

{
       long double t,w,h;
       int64_t ix,jx;

    /* High word of |x|. */
       GET_LDOUBLE_MSW64(jx,x);
       ix = jx&0x7fffffffffffffffLL;

    /* x is INF or NaN */
       if(ix>=0x7ff0000000000000LL) return x+x;

       h = 0.5;
       if (jx<0) h = -h;
    /* |x| in [0,22], return sign(x)*0.5*(E+E/(E+1))) */
       if (ix < 0x4036000000000000LL) {   /* |x|<22 */
           if (ix<0x3e20000000000000LL)   /* |x|<2**-29 */
              if(shuge+x>one) return x;/* sinhl(tiny) = tiny with inexact */
           t = __expm1l(fabsl(x));
           if(ix<0x3ff0000000000000LL) return h*(2.0*t-t*t/(t+one));
           return h*(t+t/(t+one));
       }

    /* |x| in [22, log(maxdouble)] return 0.5*exp(|x|) */
       if (ix < 0x40862e42fefa39efLL)  return h*__ieee754_expl(fabsl(x));

    /* |x| in [log(maxdouble), overflowthresold] */
       if (ix <= 0x408633ce8fb9f87dLL) {
           w = __ieee754_expl(0.5*fabsl(x));
           t = h*w;
           return t*w;
       }

    /* |x| > overflowthresold, sinh(x) overflow */
       return x*shuge;
}

Here is the call graph for this function:


Variable Documentation

long double one = 1.0 [static]

Definition at line 41 of file e_sinhl.c.

long double shuge = 1.0e307 [static]

Definition at line 41 of file e_sinhl.c.