Back to index

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

Go to the source code of this file.

Functions

double fd_asinh (double x)

Variables

static double one = 1.00000000000000000000e+00
static double ln2 = 6.93147180559945286227e-01
static double really_big = 1.00000000000000000000e+300

Function Documentation

double fd_asinh ( double  x)

Definition at line 77 of file s_asinh.c.

{      
        fd_twoints u;
       double t,w;
       int hx,ix;
        u.d = x;
       hx = __HI(u);
       ix = hx&0x7fffffff;
       if(ix>=0x7ff00000) return x+x;     /* x is inf or NaN */
       if(ix< 0x3e300000) { /* |x|<2**-28 */
           if(really_big+x>one) return x; /* return x inexact except 0 */
       } 
       if(ix>0x41b00000) {  /* |x| > 2**28 */
           w = __ieee754_log(fd_fabs(x))+ln2;
       } else if (ix>0x40000000) { /* 2**28 > |x| > 2.0 */
           t = fd_fabs(x);
           w = __ieee754_log(2.0*t+one/(fd_sqrt(x*x+one)+t));
       } else {             /* 2.0 > |x| > 2**-28 */
           t = x*x;
           w =fd_log1p(fd_fabs(x)+t/(one+fd_sqrt(one+t)));
       }
       if(hx>0) return w; else return -w;
}

Here is the call graph for this function:


Variable Documentation

double ln2 = 6.93147180559945286227e-01 [static]

Definition at line 71 of file s_asinh.c.

double one = 1.00000000000000000000e+00 [static]

Definition at line 70 of file s_asinh.c.

double really_big = 1.00000000000000000000e+300 [static]

Definition at line 72 of file s_asinh.c.