Back to index

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

Go to the source code of this file.

Functions

static float pzerof ()
static float qzerof ()
float __ieee754_j0f (float x)
float __ieee754_y0f (float x)
static float pzerof (float x)
static float qzerof (float x)

Variables

static float huge = 1e30
static float one = 1.0
static float invsqrtpi = 5.6418961287e-01
static float tpi = 6.3661974669e-01
static float R02 = 1.5625000000e-02
static float R03 = -1.8997929874e-04
static float R04 = 1.8295404516e-06
static float R05 = -4.6183270541e-09
static float S01 = 1.5619102865e-02
static float S02 = 1.1692678527e-04
static float S03 = 5.1354652442e-07
static float S04 = 1.1661400734e-09
static float zero = 0.0
static float u00 = -7.3804296553e-02
static float u01 = 1.7666645348e-01
static float u02 = -1.3818567619e-02
static float u03 = 3.4745343146e-04
static float u04 = -3.8140706238e-06
static float u05 = 1.9559013964e-08
static float u06 = -3.9820518410e-11
static float v01 = 1.2730483897e-02
static float v02 = 7.6006865129e-05
static float v03 = 2.5915085189e-07
static float v04 = 4.4111031494e-10
static float pR8 [6]
static float pS8 [5]
static float pR5 [6]
static float pS5 [5]
static float pR3 [6]
static float pS3 [5]
static float pR2 [6]
static float pS2 [5]
static float qR8 [6]
static float qS8 [6]
static float qR5 [6]
static float qS5 [6]
static float qR3 [6]
static float qS3 [6]
static float qR2 [6]
static float qS2 [6]

Function Documentation

float __ieee754_j0f ( float  x)

Definition at line 57 of file e_j0f.c.

{
       float z, s,c,ss,cc,r,u,v;
       int32_t hx,ix;

       GET_FLOAT_WORD(hx,x);
       ix = hx&0x7fffffff;
       if(ix>=0x7f800000) return one/(x*x);
       x = fabsf(x);
       if(ix >= 0x40000000) {      /* |x| >= 2.0 */
              __sincosf (x, &s, &c);
              ss = s-c;
              cc = s+c;
              if(ix<0x7f000000) {  /* make sure x+x not overflow */
                  z = -__cosf(x+x);
                  if ((s*c)<zero) cc = z/ss;
                  else          ss = z/cc;
              }
       /*
        * j0(x) = 1/sqrt(pi) * (P(0,x)*cc - Q(0,x)*ss) / sqrt(x)
        * y0(x) = 1/sqrt(pi) * (P(0,x)*ss + Q(0,x)*cc) / sqrt(x)
        */
              if(ix>0x48000000) z = (invsqrtpi*cc)/__ieee754_sqrtf(x);
              else {
                  u = pzerof(x); v = qzerof(x);
                  z = invsqrtpi*(u*cc-v*ss)/__ieee754_sqrtf(x);
              }
              return z;
       }
       if(ix<0x39000000) {  /* |x| < 2**-13 */
           if(huge+x>one) { /* raise inexact if x != 0 */
               if(ix<0x32000000) return one;     /* |x|<2**-27 */
               else        return one - (float)0.25*x*x;
           }
       }
       z = x*x;
       r =  z*(R02+z*(R03+z*(R04+z*R05)));
       s =  one+z*(S01+z*(S02+z*(S03+z*S04)));
       if(ix < 0x3F800000) {       /* |x| < 1.00 */
           return one + z*((float)-0.25+(r/s));
       } else {
           u = (float)0.5*x;
           return((one+u)*(one-u)+z*(r/s));
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

float __ieee754_y0f ( float  x)

Definition at line 125 of file e_j0f.c.

{
       float z, s,c,ss,cc,u,v;
       int32_t hx,ix;

       GET_FLOAT_WORD(hx,x);
        ix = 0x7fffffff&hx;
    /* Y0(NaN) is NaN, y0(-inf) is Nan, y0(inf) is 0, y0(0) is -inf.  */
       if(ix>=0x7f800000) return  one/(x+x*x);
        if(ix==0) return -HUGE_VALF+x;  /* -inf and overflow exception.  */
        if(hx<0) return zero/(zero*x);
        if(ix >= 0x40000000) {  /* |x| >= 2.0 */
        /* y0(x) = sqrt(2/(pi*x))*(p0(x)*sin(x0)+q0(x)*cos(x0))
         * where x0 = x-pi/4
         *      Better formula:
         *              cos(x0) = cos(x)cos(pi/4)+sin(x)sin(pi/4)
         *                      =  1/sqrt(2) * (sin(x) + cos(x))
         *              sin(x0) = sin(x)cos(3pi/4)-cos(x)sin(3pi/4)
         *                      =  1/sqrt(2) * (sin(x) - cos(x))
         * To avoid cancellation, use
         *              sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
         * to compute the worse one.
         */
              __sincosf (x, &s, &c);
                ss = s-c;
                cc = s+c;
       /*
        * j0(x) = 1/sqrt(pi) * (P(0,x)*cc - Q(0,x)*ss) / sqrt(x)
        * y0(x) = 1/sqrt(pi) * (P(0,x)*ss + Q(0,x)*cc) / sqrt(x)
        */
                if(ix<0x7f000000) {  /* make sure x+x not overflow */
                    z = -__cosf(x+x);
                    if ((s*c)<zero) cc = z/ss;
                    else            ss = z/cc;
                }
                if(ix>0x48000000) z = (invsqrtpi*ss)/__ieee754_sqrtf(x);
                else {
                    u = pzerof(x); v = qzerof(x);
                    z = invsqrtpi*(u*ss+v*cc)/__ieee754_sqrtf(x);
                }
                return z;
       }
       if(ix<=0x32000000) { /* x < 2**-27 */
           return(u00 + tpi*__ieee754_logf(x));
       }
       z = x*x;
       u = u00+z*(u01+z*(u02+z*(u03+z*(u04+z*(u05+z*u06)))));
       v = one+z*(v01+z*(v02+z*(v03+z*v04)));
       return(u/v + tpi*(__ieee754_j0f(x)*__ieee754_logf(x)));
}

Here is the call graph for this function:

Here is the caller graph for this function:

static float pzerof ( ) [static]

Here is the caller graph for this function:

static float pzerof ( float  x) [static]

Definition at line 285 of file e_j0f.c.

{
#ifdef __STDC__
       const float *p,*q;
#else
       float *p,*q;
#endif
       float z,r,s;
       int32_t ix;
       GET_FLOAT_WORD(ix,x);
       ix &= 0x7fffffff;
       if(ix>=0x41000000)     {p = pR8; q= pS8;}
       else if(ix>=0x40f71c58){p = pR5; q= pS5;}
       else if(ix>=0x4036db68){p = pR3; q= pS3;}
       else if(ix>=0x40000000){p = pR2; q= pS2;}
       z = one/(x*x);
       r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
       s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4]))));
       return one+ r/s;
}
static float qzerof ( )

Here is the caller graph for this function:

static float qzerof ( float  x) [static]

Definition at line 421 of file e_j0f.c.

{
#ifdef __STDC__
       const float *p,*q;
#else
       float *p,*q;
#endif
       float s,r,z;
       int32_t ix;
       GET_FLOAT_WORD(ix,x);
       ix &= 0x7fffffff;
       if(ix>=0x41000000)     {p = qR8; q= qS8;}
       else if(ix>=0x40f71c58){p = qR5; q= qS5;}
       else if(ix>=0x4036db68){p = qR3; q= qS3;}
       else if(ix>=0x40000000){p = qR2; q= qS2;}
       z = one/(x*x);
       r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
       s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5])))));
       return (-(float).125 + r/s)/x;
}

Variable Documentation

float huge = 1e30 [static]

Definition at line 34 of file e_j0f.c.

float invsqrtpi = 5.6418961287e-01 [static]

Definition at line 36 of file e_j0f.c.

float one = 1.0 [static]

Definition at line 35 of file e_j0f.c.

float pR2[6] [static]
Initial value:
 {

 -8.8753431271e-08, 
 -7.0303097367e-02, 
 -1.4507384300e+00, 
 -7.6356959343e+00, 
 -1.1193166733e+01, 
 -3.2336456776e+00, 
}

Definition at line 261 of file e_j0f.c.

float pR3[6] [static]
Initial value:
 {

 -2.5470459075e-09, 
 -7.0311963558e-02, 
 -2.4090321064e+00, 
 -2.1965976715e+01, 
 -5.8079170227e+01, 
 -3.1447946548e+01, 
}

Definition at line 237 of file e_j0f.c.

float pR5[6] [static]
Initial value:
 { 

 -1.1412546255e-11, 
 -7.0312492549e-02, 
 -4.1596107483e+00, 
 -6.7674766541e+01, 
 -3.3123129272e+02, 
 -3.4643338013e+02, 
}

Definition at line 213 of file e_j0f.c.

float pR8[6] [static]
Initial value:
 { 

  0.0000000000e+00, 
 -7.0312500000e-02, 
 -8.0816707611e+00, 
 -2.5706311035e+02, 
 -2.4852163086e+03, 
 -5.2530439453e+03, 
}

Definition at line 190 of file e_j0f.c.

float pS2[5] [static]
Initial value:
 {

  2.2220300674e+01, 
  1.3620678711e+02, 
  2.7047027588e+02, 
  1.5387539673e+02, 
  1.4657617569e+01, 
}

Definition at line 273 of file e_j0f.c.

float pS3[5] [static]
Initial value:
 {

  3.5856033325e+01, 
  3.6151397705e+02, 
  1.1936077881e+03, 
  1.1279968262e+03, 
  1.7358093262e+02, 
}

Definition at line 249 of file e_j0f.c.

float pS5[5] [static]
Initial value:
 {

  6.0753936768e+01, 
  1.0512523193e+03, 
  5.9789707031e+03, 
  9.6254453125e+03, 
  2.4060581055e+03, 
}

Definition at line 225 of file e_j0f.c.

float pS8[5] [static]
Initial value:
 {

  1.1653436279e+02, 
  3.8337448730e+03, 
  4.0597855469e+04, 
  1.1675296875e+05, 
  4.7627726562e+04, 
}

Definition at line 202 of file e_j0f.c.

float qR2[6] [static]
Initial value:
 {

  1.5044444979e-07, 
  7.3223426938e-02, 
  1.9981917143e+00, 
  1.4495602608e+01, 
  3.1666231155e+01, 
  1.6252708435e+01, 
}

Definition at line 396 of file e_j0f.c.

float qR3[6] [static]
Initial value:
 {

  4.3774099900e-09, 
  7.3241114616e-02, 
  3.3442313671e+00, 
  4.2621845245e+01, 
  1.7080809021e+02, 
  1.6673394775e+02, 
}

Definition at line 371 of file e_j0f.c.

float qR5[6] [static]
Initial value:
 { 

  1.8408595828e-11, 
  7.3242180049e-02, 
  5.8356351852e+00, 
  1.3511157227e+02, 
  1.0272437744e+03, 
  1.9899779053e+03, 
}

Definition at line 346 of file e_j0f.c.

float qR8[6] [static]
Initial value:
 { 

  0.0000000000e+00, 
  7.3242187500e-02, 
  1.1768206596e+01, 
  5.5767340088e+02, 
  8.8591972656e+03, 
  3.7014625000e+04, 
}

Definition at line 321 of file e_j0f.c.

float qS2[6] [static]
Initial value:
 {

  3.0365585327e+01, 
  2.6934811401e+02, 
  8.4478375244e+02, 
  8.8293585205e+02, 
  2.1266638184e+02, 
 -5.3109550476e+00, 
}

Definition at line 408 of file e_j0f.c.

float qS3[6] [static]
Initial value:
 {

  4.8758872986e+01, 
  7.0968920898e+02, 
  3.7041481934e+03, 
  6.4604252930e+03, 
  2.5163337402e+03, 
 -1.4924745178e+02, 
}

Definition at line 383 of file e_j0f.c.

float qS5[6] [static]
Initial value:
 {

  8.2776611328e+01, 
  2.0778142090e+03, 
  1.8847289062e+04, 
  5.6751113281e+04, 
  3.5976753906e+04, 
 -5.3543427734e+03, 
}

Definition at line 358 of file e_j0f.c.

float qS8[6] [static]
Initial value:
 {

  1.6377603149e+02, 
  8.0983447266e+03, 
  1.4253829688e+05, 
  8.0330925000e+05, 
  8.4050156250e+05, 
 -3.4389928125e+05, 
}

Definition at line 333 of file e_j0f.c.

float R02 = 1.5625000000e-02 [static]

Definition at line 39 of file e_j0f.c.

float R03 = -1.8997929874e-04 [static]

Definition at line 40 of file e_j0f.c.

float R04 = 1.8295404516e-06 [static]

Definition at line 41 of file e_j0f.c.

float R05 = -4.6183270541e-09 [static]

Definition at line 42 of file e_j0f.c.

float S01 = 1.5619102865e-02 [static]

Definition at line 43 of file e_j0f.c.

float S02 = 1.1692678527e-04 [static]

Definition at line 44 of file e_j0f.c.

float S03 = 5.1354652442e-07 [static]

Definition at line 45 of file e_j0f.c.

float S04 = 1.1661400734e-09 [static]

Definition at line 46 of file e_j0f.c.

float tpi = 6.3661974669e-01 [static]

Definition at line 37 of file e_j0f.c.

float u00 = -7.3804296553e-02 [static]

Definition at line 110 of file e_j0f.c.

float u01 = 1.7666645348e-01 [static]

Definition at line 111 of file e_j0f.c.

float u02 = -1.3818567619e-02 [static]

Definition at line 112 of file e_j0f.c.

float u03 = 3.4745343146e-04 [static]

Definition at line 113 of file e_j0f.c.

float u04 = -3.8140706238e-06 [static]

Definition at line 114 of file e_j0f.c.

float u05 = 1.9559013964e-08 [static]

Definition at line 115 of file e_j0f.c.

float u06 = -3.9820518410e-11 [static]

Definition at line 116 of file e_j0f.c.

float v01 = 1.2730483897e-02 [static]

Definition at line 117 of file e_j0f.c.

float v02 = 7.6006865129e-05 [static]

Definition at line 118 of file e_j0f.c.

float v03 = 2.5915085189e-07 [static]

Definition at line 119 of file e_j0f.c.

float v04 = 4.4111031494e-10 [static]

Definition at line 120 of file e_j0f.c.

float zero = 0.0 [static]

Definition at line 51 of file e_j0f.c.