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
static long double ovf_thresh = 1.1357216553474703894801348310092223067821E4L

Function Documentation

long double __ieee754_sinhl ( long double  x)

Definition at line 72 of file e_sinhl.c.

{
  long double t, w, h;
  u_int32_t jx, ix;
  ieee854_long_double_shape_type u;

  /* Words of |x|. */
  u.value = x;
  jx = u.parts32.w0;
  ix = jx & 0x7fffffff;

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

  h = 0.5;
  if (jx & 0x80000000)
    h = -h;

  /* Absolute value of x.  */
  u.parts32.w0 = ix;

  /* |x| in [0,40], return sign(x)*0.5*(E+E/(E+1))) */
  if (ix <= 0x40044000)
    {
      if (ix < 0x3fc60000) /* |x| < 2^-57 */
       if (shuge + x > one)
         return x;          /* sinh(tiny) = tiny with inexact */
      t = __expm1l (u.value);
      if (ix < 0x3fff0000)
       return h * (2.0 * t - t * t / (t + one));
      return h * (t + t / (t + one));
    }

  /* |x| in [40, log(maxdouble)] return 0.5*exp(|x|) */
  if (ix <= 0x400c62e3) /* 11356.375 */
    return h * __ieee754_expl (u.value);

  /* |x| in [log(maxdouble), overflowthreshold]
     Overflow threshold is log(2 * maxdouble).  */
  if (u.value <= ovf_thresh)
    {
      w = __ieee754_expl (0.5 * u.value);
      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 63 of file e_sinhl.c.

long double ovf_thresh = 1.1357216553474703894801348310092223067821E4L [static]

Definition at line 64 of file e_sinhl.c.

long double shuge = 1.0e4931L [static]

Definition at line 63 of file e_sinhl.c.