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.0e4931L

Function Documentation

long double __ieee754_sinhl ( long double  x)

Definition at line 51 of file e_sinhl.c.

{
       long double t,w,h;
       u_int32_t jx,ix,i0,i1;

    /* Words of |x|. */
       GET_LDOUBLE_WORDS(jx,i0,i1,x);
       ix = jx&0x7fff;

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

       h = 0.5;
       if (jx & 0x8000) h = -h;
    /* |x| in [0,25], return sign(x)*0.5*(E+E/(E+1))) */
       if (ix < 0x4003 || (ix == 0x4003 && i0 <= 0xc8000000)) { /* |x|<25 */
           if (ix<0x3fdf)          /* |x|<2**-32 */
              if(shuge+x>one) return x;/* sinh(tiny) = tiny with inexact */
           t = __expm1l(fabsl(x));
           if(ix<0x3fff) return h*(2.0*t-t*t/(t+one));
           return h*(t+t/(t+one));
       }

    /* |x| in [25, log(maxdouble)] return 0.5*exp(|x|) */
       if (ix < 0x400c || (ix == 0x400c && i0 < 0xb17217f7))
              return h*__ieee754_expl(fabsl(x));

    /* |x| in [log(maxdouble), overflowthreshold] */
       if (ix<0x400c || (ix == 0x400c && (i0 < 0xb174ddc0
                                      || (i0 == 0xb174ddc0
                                          && i1 <= 0x31aec0ea)))) {
           w = __ieee754_expl(0.5*fabsl(x));
           t = h*w;
           return t*w;
       }

    /* |x| > overflowthreshold, sinhl(x) overflow */
       return x*shuge;
}

Here is the call graph for this function:


Variable Documentation

long double one = 1.0 [static]

Definition at line 45 of file e_sinhl.c.

long double shuge = 1.0e4931L [static]

Definition at line 45 of file e_sinhl.c.