Back to index

lightning-sunbird  0.9+nobinonly
Functions | Variables
e_sinh.c File Reference
#include "fdlibm.h"

Go to the source code of this file.

Functions

double __ieee754_sinh (double x)

Variables

static double one = 1.0
static double shuge = 1.0e307

Function Documentation

double __ieee754_sinh ( double  x)

Definition at line 81 of file e_sinh.c.

{      
        fd_twoints u;
       double t,w,h;
       int ix,jx;
       unsigned lx;

    /* High word of |x|. */
        u.d = x;
       jx = __HI(u);
       ix = jx&0x7fffffff;

    /* x is INF or NaN */
       if(ix>=0x7ff00000) 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 < 0x40360000) {             /* |x|<22 */
           if (ix<0x3e300000)             /* |x|<2**-28 */
              if(shuge+x>one) return x;/* sinh(tiny) = tiny with inexact */
           t = fd_expm1(fd_fabs(x));
           if(ix<0x3ff00000) 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 < 0x40862E42)  return h*__ieee754_exp(fd_fabs(x));

    /* |x| in [log(maxdouble), overflowthresold] */
       lx = *( (((*(unsigned*)&one)>>29)) + (unsigned*)&x);
       if (ix<0x408633CE || (ix==0x408633ce)&&(lx<=(unsigned)0x8fb9f87d)) {
           w = __ieee754_exp(0.5*fd_fabs(x));
           t = h*w;
           return t*w;
       }

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

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

double one = 1.0 [static]

Definition at line 75 of file e_sinh.c.

double shuge = 1.0e307 [static]

Definition at line 75 of file e_sinh.c.