Back to index

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

Go to the source code of this file.

Functions

float __ieee754_asinf (float x)

Variables

static float one = 1.0000000000e+00
static float huge = 1.000e+30
static float pio2_hi = 1.57079637050628662109375f
static float pio2_lo = -4.37113900018624283e-8f
static float pio4_hi = 0.785398185253143310546875f
static float p0 = 1.666675248e-1f
static float p1 = 7.495297643e-2f
static float p2 = 4.547037598e-2f
static float p3 = 2.417951451e-2f
static float p4 = 4.216630880e-2f

Function Documentation

float __ieee754_asinf ( float  x)

Definition at line 69 of file e_asinf.c.

{
       float t,w,p,q,c,r,s;
       int32_t hx,ix;
       GET_FLOAT_WORD(hx,x);
       ix = hx&0x7fffffff;
       if(ix==0x3f800000) {
              /* asin(1)=+-pi/2 with inexact */
           return x*pio2_hi+x*pio2_lo;
       } else if(ix> 0x3f800000) { /* |x|>= 1 */
           return (x-x)/(x-x);            /* asin(|x|>1) is NaN */
       } else if (ix<0x3f000000) { /* |x|<0.5 */
           if(ix<0x32000000) {            /* if |x| < 2**-27 */
              if(huge+x>one) return x;/* return x with inexact if x!=0*/
           } else {
              t = x*x;
              w = t * (p0 + t * (p1 + t * (p2 + t * (p3 + t * p4))));
              return x+x*w;
           }
       }
       /* 1> |x|>= 0.5 */
       w = one-fabsf(x);
       t = w*0.5f;
       p = t * (p0 + t * (p1 + t * (p2 + t * (p3 + t * p4))));
       s = __ieee754_sqrtf(t);
       if(ix>=0x3F79999A) {        /* if |x| > 0.975 */
           t = pio2_hi-(2.0f*(s+s*p)-pio2_lo);
       } else {
           int32_t iw;
           w  = s;
           GET_FLOAT_WORD(iw,w);
           SET_FLOAT_WORD(w,iw&0xfffff000);
           c  = (t-w*w)/(s+w);
           r  = p;
           p  = 2.0f*s*r-(pio2_lo-2.0f*c);
           q  = pio4_hi-2.0f*w;
           t  = pio4_hi-(p-q);
       }
       if(hx>0) return t; else return -t;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

float huge = 1.000e+30 [static]

Definition at line 51 of file e_asinf.c.

float one = 1.0000000000e+00 [static]

Definition at line 50 of file e_asinf.c.

float p0 = 1.666675248e-1f [static]

Definition at line 60 of file e_asinf.c.

float p1 = 7.495297643e-2f [static]

Definition at line 61 of file e_asinf.c.

float p2 = 4.547037598e-2f [static]

Definition at line 62 of file e_asinf.c.

float p3 = 2.417951451e-2f [static]

Definition at line 63 of file e_asinf.c.

float p4 = 4.216630880e-2f [static]

Definition at line 64 of file e_asinf.c.

float pio2_hi = 1.57079637050628662109375f [static]

Definition at line 53 of file e_asinf.c.

float pio2_lo = -4.37113900018624283e-8f [static]

Definition at line 54 of file e_asinf.c.

float pio4_hi = 0.785398185253143310546875f [static]

Definition at line 55 of file e_asinf.c.