Back to index

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

Go to the source code of this file.

Functions

float __ieee754_acosf (float x)

Variables

static float one = 1.0000000000e+00
static float pi = 3.1415925026e+00
static float pio2_hi = 1.5707962513e+00
static float pio2_lo = 7.5497894159e-08
static float pS0 = 1.6666667163e-01
static float pS1 = -3.2556581497e-01
static float pS2 = 2.0121252537e-01
static float pS3 = -4.0055535734e-02
static float pS4 = 7.9153501429e-04
static float pS5 = 3.4793309169e-05
static float qS1 = -2.4033949375e+00
static float qS2 = 2.0209457874e+00
static float qS3 = -6.8828397989e-01
static float qS4 = 7.7038154006e-02

Function Documentation

float __ieee754_acosf ( float  x)

Definition at line 46 of file e_acosf.c.

{
       float z,p,q,r,w,s,c,df;
       int32_t hx,ix;
       GET_FLOAT_WORD(hx,x);
       ix = hx&0x7fffffff;
       if(ix==0x3f800000) {        /* |x|==1 */
           if(hx>0) return 0.0;    /* acos(1) = 0  */
           else return pi+(float)2.0*pio2_lo;    /* acos(-1)= pi */
       } else if(ix>0x3f800000) {  /* |x| >= 1 */
           return (x-x)/(x-x);            /* acos(|x|>1) is NaN */
       }
       if(ix<0x3f000000) {  /* |x| < 0.5 */
           if(ix<=0x23000000) return pio2_hi+pio2_lo;/*if|x|<2**-57*/
           z = x*x;
           p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
           q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
           r = p/q;
           return pio2_hi - (x - (pio2_lo-x*r));
       } else  if (hx<0) {         /* x < -0.5 */
           z = (one+x)*(float)0.5;
           p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
           q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
           s = __ieee754_sqrtf(z);
           r = p/q;
           w = r*s-pio2_lo;
           return pi - (float)2.0*(s+w);
       } else {                    /* x > 0.5 */
           int32_t idf;
           z = (one-x)*(float)0.5;
           s = __ieee754_sqrtf(z);
           df = s;
           GET_FLOAT_WORD(idf,df);
           SET_FLOAT_WORD(df,idf&0xfffff000);
           c  = (z-df*df)/(s+df);
           p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
           q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
           r = p/q;
           w = r*s+c;
           return (float)2.0*(df+w);
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

float one = 1.0000000000e+00 [static]

Definition at line 28 of file e_acosf.c.

float pi = 3.1415925026e+00 [static]

Definition at line 29 of file e_acosf.c.

float pio2_hi = 1.5707962513e+00 [static]

Definition at line 30 of file e_acosf.c.

float pio2_lo = 7.5497894159e-08 [static]

Definition at line 31 of file e_acosf.c.

float pS0 = 1.6666667163e-01 [static]

Definition at line 32 of file e_acosf.c.

float pS1 = -3.2556581497e-01 [static]

Definition at line 33 of file e_acosf.c.

float pS2 = 2.0121252537e-01 [static]

Definition at line 34 of file e_acosf.c.

float pS3 = -4.0055535734e-02 [static]

Definition at line 35 of file e_acosf.c.

float pS4 = 7.9153501429e-04 [static]

Definition at line 36 of file e_acosf.c.

float pS5 = 3.4793309169e-05 [static]

Definition at line 37 of file e_acosf.c.

float qS1 = -2.4033949375e+00 [static]

Definition at line 38 of file e_acosf.c.

float qS2 = 2.0209457874e+00 [static]

Definition at line 39 of file e_acosf.c.

float qS3 = -6.8828397989e-01 [static]

Definition at line 40 of file e_acosf.c.

float qS4 = 7.7038154006e-02 [static]

Definition at line 41 of file e_acosf.c.