Back to index

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

Go to the source code of this file.

Functions

double __ieee754_acosh (double x)

Variables

static double one = 1.0
static double ln2 = 6.93147180559945286227e-01

Function Documentation

double __ieee754_acosh ( double  x)

Definition at line 45 of file e_acosh.c.

{      
       double t;
       int32_t hx;
       u_int32_t lx;
       EXTRACT_WORDS(hx,lx,x);
       if(hx<0x3ff00000) {         /* x < 1 */
           return (x-x)/(x-x);
       } else if(hx >=0x41b00000) {       /* x > 2**28 */
           if(hx >=0x7ff00000) {   /* x is inf of NaN */
               return x+x;
           } else 
              return __ieee754_log(x)+ln2;       /* acosh(huge)=log(2x) */
       } else if(((hx-0x3ff00000)|lx)==0) {
           return 0.0;                    /* acosh(1) = 0 */
       } else if (hx > 0x40000000) {      /* 2**28 > x > 2 */
           t=x*x;
           return __ieee754_log(2.0*x-one/(x+__ieee754_sqrt(t-one)));
       } else {                    /* 1<x<2 */
           t = x-one;
           return __log1p(t+__sqrt(2.0*t+t*t));
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

double ln2 = 6.93147180559945286227e-01 [static]

Definition at line 40 of file e_acosh.c.

double one = 1.0 [static]

Definition at line 39 of file e_acosh.c.