math_private.h File Reference
`#include "SDL_endian.h"`
Include dependency graph for math_private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures

union | ieee_double_shape_type
union | ieee_float_shape_type

## Macros

#define | _IEEE_LIBM
#define | attribute_hidden
#define | libm_hidden_proto(x)
#define | libm_hidden_def(x)
#define | strong_alias(x, y)
#define | atan SDL_uclibc_atan
#define | __ieee754_atan2 SDL_uclibc_atan2
#define | copysign SDL_uclibc_copysign
#define | cos SDL_uclibc_cos
#define | __ieee754_exp SDL_uclibc_exp
#define | fabs SDL_uclibc_fabs
#define | floor SDL_uclibc_floor
#define | __ieee754_fmod SDL_uclibc_fmod
#define | __ieee754_log SDL_uclibc_log
#define | __ieee754_log10 SDL_uclibc_log10
#define | __ieee754_pow SDL_uclibc_pow
#define | scalbln SDL_uclibc_scalbln
#define | scalbn SDL_uclibc_scalbn
#define | sin SDL_uclibc_sin
#define | __ieee754_sqrt SDL_uclibc_sqrt
#define | tan SDL_uclibc_tan
#define | EXTRACT_WORDS(ix0, ix1, d)
#define | GET_HIGH_WORD(i, d)
#define | GET_LOW_WORD(i, d)
#define | INSERT_WORDS(d, ix0, ix1)
#define | SET_HIGH_WORD(d, v)
#define | SET_LOW_WORD(d, v)
#define | GET_FLOAT_WORD(i, d)
#define | SET_FLOAT_WORD(d, i)

## Typedefs

typedef unsigned int | u_int32_t

## Functions

double | __ieee754_sqrt (double) attribute_hidden
double | __ieee754_acos (double) attribute_hidden
double | __ieee754_acosh (double) attribute_hidden
double | __ieee754_log (double) attribute_hidden
double | __ieee754_atanh (double) attribute_hidden
double | __ieee754_asin (double) attribute_hidden
double | __ieee754_atan2 (double, double) attribute_hidden
double | __ieee754_exp (double) attribute_hidden
double | __ieee754_cosh (double) attribute_hidden
double | __ieee754_fmod (double, double) attribute_hidden
double | __ieee754_pow (double, double) attribute_hidden
double | __ieee754_lgamma_r (double, int *) attribute_hidden
double | __ieee754_gamma_r (double, int *) attribute_hidden
double | __ieee754_lgamma (double) attribute_hidden
double | __ieee754_gamma (double) attribute_hidden
double | __ieee754_log10 (double) attribute_hidden
double | __ieee754_sinh (double) attribute_hidden
double | __ieee754_hypot (double, double) attribute_hidden
double | __ieee754_j0 (double) attribute_hidden
double | __ieee754_j1 (double) attribute_hidden
double | __ieee754_y0 (double) attribute_hidden
double | __ieee754_y1 (double) attribute_hidden
double | __ieee754_jn (int, double) attribute_hidden
double | __ieee754_yn (int, double) attribute_hidden
double | __ieee754_remainder (double, double) attribute_hidden
int32_t | __ieee754_rem_pio2 (double, double *) attribute_hidden
double | __ieee754_scalb (double, double) attribute_hidden
double | __kernel_sin (double, double, int) attribute_hidden
double | __kernel_cos (double, double) attribute_hidden
double | __kernel_tan (double, double, int) attribute_hidden
int32_t | __kernel_rem_pio2 (double *, double *, int, int, const unsigned int, const int32_t *) attribute_hidden

## Macro Definition Documentation

## __ieee754_atan2

#define __ieee754_atan2 SDL_uclibc_atan2

Definition at line 35 of file math_private.h.

## __ieee754_exp

#define __ieee754_exp SDL_uclibc_exp

Definition at line 38 of file math_private.h.

## __ieee754_fmod

#define __ieee754_fmod SDL_uclibc_fmod

Definition at line 41 of file math_private.h.

## __ieee754_log

#define __ieee754_log SDL_uclibc_log

Definition at line 42 of file math_private.h.

## __ieee754_log10

#define __ieee754_log10 SDL_uclibc_log10

Definition at line 43 of file math_private.h.

## __ieee754_pow

#define __ieee754_pow SDL_uclibc_pow

Definition at line 44 of file math_private.h.

## __ieee754_sqrt

#define __ieee754_sqrt SDL_uclibc_sqrt

Definition at line 48 of file math_private.h.

## _IEEE_LIBM

#define _IEEE_LIBM

Definition at line 24 of file math_private.h.

## atan

#define atan SDL_uclibc_atan

Definition at line 34 of file math_private.h.

## attribute_hidden

#define attribute_hidden

Definition at line 25 of file math_private.h.

## copysign

#define copysign SDL_uclibc_copysign

Definition at line 36 of file math_private.h.

## cos

#define cos SDL_uclibc_cos

Definition at line 37 of file math_private.h.

## EXTRACT_WORDS

#define EXTRACT_WORDS | ( |  | ix0,
|  |  | ix1,
|  |  | d
| ) |  |

Value:
do { \
ieee_double_shape_type ew_u; \
ew_u.value = (d); \
(ix0) = ew_u.parts.msw; \
(ix1) = ew_u.parts.lsw; \
} while (0)

Definition at line 99 of file math_private.h.

## fabs

#define fabs SDL_uclibc_fabs

Definition at line 39 of file math_private.h.

## floor

#define floor SDL_uclibc_floor

Definition at line 40 of file math_private.h.

## GET_FLOAT_WORD

#define GET_FLOAT_WORD | ( |  | i,
|  |  | d
| ) |  |

Value:
do { \
ieee_float_shape_type gf_u; \
gf_u.value = (d); \
(i) = gf_u.word; \
} while (0)

Definition at line 166 of file math_private.h.

## GET_HIGH_WORD

#define GET_HIGH_WORD | ( |  | i,
|  |  | d
| ) |  |

Value:
do { \
ieee_double_shape_type gh_u; \
gh_u.value = (d); \
(i) = gh_u.parts.msw; \
} while (0)

Definition at line 109 of file math_private.h.

## GET_LOW_WORD

#define GET_LOW_WORD | ( |  | i,
|  |  | d
| ) |  |

Value:
do { \
ieee_double_shape_type gl_u; \
gl_u.value = (d); \
(i) = gl_u.parts.lsw; \
} while (0)

Definition at line 118 of file math_private.h.

## INSERT_WORDS

#define INSERT_WORDS | ( |  | d,
|  |  | ix0,
|  |  | ix1
| ) |  |

Value:
do { \
ieee_double_shape_type iw_u; \
iw_u.parts.msw = (ix0); \
iw_u.parts.lsw = (ix1); \
(d) = iw_u.value; \
} while (0)

Definition at line 127 of file math_private.h.

## libm_hidden_def

#define libm_hidden_def | ( |  | x | ) |

Definition at line 27 of file math_private.h.

## libm_hidden_proto

#define libm_hidden_proto | ( |  | x | ) |

Definition at line 26 of file math_private.h.

## scalbln

#define scalbln SDL_uclibc_scalbln

Definition at line 45 of file math_private.h.

## scalbn

#define scalbn SDL_uclibc_scalbn

Definition at line 46 of file math_private.h.

## SET_FLOAT_WORD

#define SET_FLOAT_WORD | ( |  | d,
|  |  | i
| ) |  |

Value:
do { \
ieee_float_shape_type sf_u; \
sf_u.word = (i); \
(d) = sf_u.value; \
} while (0)

Definition at line 175 of file math_private.h.

## SET_HIGH_WORD

#define SET_HIGH_WORD | ( |  | d,
|  |  | v
| ) |  |

Value:
do { \
ieee_double_shape_type sh_u; \
sh_u.value = (d); \
sh_u.parts.msw = (v); \
(d) = sh_u.value; \
} while (0)

Definition at line 137 of file math_private.h.

## SET_LOW_WORD

#define SET_LOW_WORD | ( |  | d,
|  |  | v
| ) |  |

Value:
do { \
ieee_double_shape_type sl_u; \
sl_u.value = (d); \
sl_u.parts.lsw = (v); \
(d) = sl_u.value; \
} while (0)

Definition at line 147 of file math_private.h.

## sin

#define sin SDL_uclibc_sin

Definition at line 47 of file math_private.h.

## strong_alias

#define strong_alias | ( |  | x,
|  |  | y
| ) |  |

Definition at line 28 of file math_private.h.

## tan

#define tan SDL_uclibc_tan

Definition at line 49 of file math_private.h.

## Typedef Documentation

## u_int32_t

typedef unsigned int u_int32_t

Definition at line 31 of file math_private.h.

## Function Documentation

## __ieee754_acos()

double __ieee754_acos | ( | double |  | ) |

## __ieee754_acosh()

double __ieee754_acosh | ( | double |  | ) |

## __ieee754_asin()

double __ieee754_asin | ( | double |  | ) |

## __ieee754_atan2()

double __ieee754_atan2 | ( | double | ,
|  | double |
| ) |  |

Definition at line 50 of file e_atan2.c.

{
double z;
int32_t k,m,hx,hy,ix,iy;
u_int32_t lx,ly;
EXTRACT_WORDS(hx,lx,x);
ix = hx&0x7fffffff;
EXTRACT_WORDS(hy,ly,y);
iy = hy&0x7fffffff;
if(((ix|((lx|-(int32_t)lx)>>31))>0x7ff00000)||
((iy|((ly|-(int32_t)ly)>>31))>0x7ff00000)) /* x or y is NaN */
return x+y;
if(((hx-0x3ff00000)|lx)==0) return atan(y); /* x=1.0 */
m = ((hy>>31)&1)|((hx>>30)&2); /* 2*sign(x)+sign(y) */
/* when y = 0 */
if((iy|ly)==0) {
switch(m) {
case 0:
case 1: return y; /* atan(+-0,+anything)=+-0 */
case 2: return pi+tiny;/* atan(+0,-anything) = pi */
case 3: return -pi-tiny;/* atan(-0,-anything) =-pi */
}
}
/* when x = 0 */
if((ix|lx)==0) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny;
/* when x is INF */
if(ix==0x7ff00000) {
if(iy==0x7ff00000) {
switch(m) {
case 0: return pi_o_4+tiny;/* atan(+INF,+INF) */
case 1: return -pi_o_4-tiny;/* atan(-INF,+INF) */
case 2: return 3.0*pi_o_4+tiny;/*atan(+INF,-INF)*/
case 3: return -3.0*pi_o_4-tiny;/*atan(-INF,-INF)*/
}
} else {
switch(m) {
case 0: return zero ; /* atan(+...,+INF) */
case 1: return -zero ; /* atan(-...,+INF) */
case 2: return pi+tiny ; /* atan(+...,-INF) */
case 3: return -pi-tiny ; /* atan(-...,-INF) */
}
}
}
/* when y is INF */
if(iy==0x7ff00000) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny;
/* compute y/x */
k = (iy-ix)>>20;
if(k > 60) z=pi_o_2+0.5*pi_lo; /* |y/x| > 2**60 */
else if(hx<0&&k<-60) z=0.0; /* |y|/x < -2**60 */
else z=atan(fabs(y/x)); /* safe to do y/x */
switch (m) {
case 0: return z ; /* atan(+,+) */
case 1: {
u_int32_t zh;
GET_HIGH_WORD(zh,z);
SET_HIGH_WORD(z,zh ^ 0x80000000);
}
return z ; /* atan(-,+) */
case 2: return pi-(z-pi_lo);/* atan(+,-) */
default: /* case 3 */
return (z-pi_lo)-pi;/* atan(-,-) */
}
}

References atan(), EXTRACT_WORDS, fabs(), GET_HIGH_WORD, k, pi, pi_lo, pi_o_2, pi_o_4, SET_HIGH_WORD, tiny, and zero.

## __ieee754_atanh()

double __ieee754_atanh | ( | double |  | ) |

## __ieee754_cosh()

double __ieee754_cosh | ( | double |  | ) |

## __ieee754_exp()

double __ieee754_exp | ( | double |  | ) |

Definition at line 100 of file e_exp.c.

{
double y;
double hi = 0.0;
double lo = 0.0;
double c;
double t;
int32_t k=0;
int32_t xsb;
u_int32_t hx;
GET_HIGH_WORD(hx,x);
xsb = (hx>>31)&1; /* sign bit of x */
hx &= 0x7fffffff; /* high word of |x| */
/* filter out non-finite argument */
if(hx >= 0x40862E42) { /* if |x|>=709.78... */
if(hx>=0x7ff00000) {
u_int32_t lx;
GET_LOW_WORD(lx,x);
if(((hx&0xfffff)|lx)!=0)
return x+x; /* NaN */
else return (xsb==0)? x:0.0; /* exp(+-inf)={inf,0} */
}
#if 1
if(x > o_threshold) return huge*huge; /* overflow */
#else /* !!! FIXME: check this: "huge * huge" is a compiler warning, maybe they wanted +Inf? */
if(x > o_threshold) return INFINITY; /* overflow */
#endif
if(x < u_threshold) return twom1000*twom1000; /* underflow */
}
/* argument reduction */
if(hx > 0x3fd62e42) { /* if |x| > 0.5 ln2 */
if(hx < 0x3FF0A2B2) { /* and |x| < 1.5 ln2 */
hi = x-ln2HI[xsb]; lo=ln2LO[xsb]; k = 1-xsb-xsb;
} else {
k = (int32_t) (invln2*x+halF[xsb]);
t = k;
hi = x - t*ln2HI[0]; /* t*ln2HI is exact here */
lo = t*ln2LO[0];
}
x = hi - lo;
}
else if(hx < 0x3e300000) { /* when |x|<2**-28 */
if(huge+x>one) return one+x;/* trigger inexact */
}
else k = 0;
/* x is now in primary range */
t = x*x;
c = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5))));
if(k==0) return one-((x*c)/(c-2.0)-x);
else y = one-((lo-(x*c)/(2.0-c))-hi);
if(k >= -1021) {
u_int32_t hy;
GET_HIGH_WORD(hy,y);
SET_HIGH_WORD(y,hy+(k<<20)); /* add k to y's exponent */
return y;
} else {
u_int32_t hy;
GET_HIGH_WORD(hy,y);
SET_HIGH_WORD(y,hy+((k+1000)<<20)); /* add k to y's exponent */
return y*twom1000;
}
}

References GET_HIGH_WORD, GET_LOW_WORD, halF, huge, invln2, k, ln2HI, ln2LO, o_threshold, one, P1, P2, P3, P4, P5, SET_HIGH_WORD, twom1000, and u_threshold.

## __ieee754_fmod()

double __ieee754_fmod | ( | double | ,
|  | double |
| ) |  |

Definition at line 23 of file e_fmod.c.

{
int32_t n,hx,hy,hz,ix,iy,sx,i;
u_int32_t lx,ly,lz;
EXTRACT_WORDS(hx,lx,x);
EXTRACT_WORDS(hy,ly,y);
sx = hx&0x80000000; /* sign of x */
hx ^=sx; /* |x| */
hy &= 0x7fffffff; /* |y| */
/* purge off exception values */
if((hy|ly)==0||(hx>=0x7ff00000)|| /* y=0,or x not finite */
((hy|((ly|-(int32_t)ly)>>31))>0x7ff00000)) /* or y is NaN */
return (x*y)/(x*y);
if(hx<=hy) {
if((hx<hy)||(lx<ly)) return x; /* |x|<|y| return x */
if(lx==ly)
return Zero[(u_int32_t)sx>>31]; /* |x|=|y| return x*0*/
}
/* determine ix = ilogb(x) */
if(hx<0x00100000) { /* subnormal x */
if(hx==0) {
for (ix = -1043, i=lx; i>0; i<<=1) ix -=1;
} else {
for (ix = -1022,i=(hx<<11); i>0; i<<=1) ix -=1;
}
} else ix = (hx>>20)-1023;
/* determine iy = ilogb(y) */
if(hy<0x00100000) { /* subnormal y */
if(hy==0) {
for (iy = -1043, i=ly; i>0; i<<=1) iy -=1;
} else {
for (iy = -1022,i=(hy<<11); i>0; i<<=1) iy -=1;
}
} else iy = (hy>>20)-1023;
/* set up {hx,lx}, {hy,ly} and align y to x */
if(ix >= -1022)
hx = 0x00100000|(0x000fffff&hx);
else { /* subnormal x, shift x to normal */
n = -1022-ix;
if(n<=31) {
hx = (hx<<n)|(lx>>(32-n));
lx <<= n;
} else {
hx = lx<<(n-32);
lx = 0;
}
}
if(iy >= -1022)
hy = 0x00100000|(0x000fffff&hy);
else { /* subnormal y, shift y to normal */
n = -1022-iy;
if(n<=31) {
hy = (hy<<n)|(ly>>(32-n));
ly <<= n;
} else {
hy = ly<<(n-32);
ly = 0;
}
}
/* fix point fmod */
n = ix - iy;
while(n--) {
hz=hx-hy;lz=lx-ly; if(lx<ly) hz -= 1;
if(hz<0){hx = hx+hx+(lx>>31); lx = lx+lx;}
else {
if((hz|lz)==0) /* return sign(x)*0 */
return Zero[(u_int32_t)sx>>31];
hx = hz+hz+(lz>>31); lx = lz+lz;
}
}
hz=hx-hy;lz=lx-ly; if(lx<ly) hz -= 1;
if(hz>=0) {hx=hz;lx=lz;}
/* convert back to floating value and restore the sign */
if((hx|lx)==0) /* return sign(x)*0 */
return Zero[(u_int32_t)sx>>31];
while(hx<0x00100000) { /* normalize x */
hx = hx+hx+(lx>>31); lx = lx+lx;
iy -= 1;
}
if(iy>= -1022) { /* normalize output */
hx = ((hx-0x00100000)|((iy+1023)<<20));
INSERT_WORDS(x,hx|sx,lx);
} else { /* subnormal output */
n = -1022 - iy;
if(n<=20) {
lx = (lx>>n)|((u_int32_t)hx<<(32-n));
hx >>= n;
} else if (n<=31) {
lx = (hx<<(32-n))|(lx>>n); hx = sx;
} else {
lx = hx>>(n-32); hx = sx;
}
INSERT_WORDS(x,hx|sx,lx);
x *= one; /* create necessary signal */
}
return x; /* exact output */
}

References EXTRACT_WORDS, i, INSERT_WORDS, one, and Zero.

## __ieee754_gamma()

double __ieee754_gamma | ( | double |  | ) |

## __ieee754_gamma_r()

double __ieee754_gamma_r | ( | double | ,
|  | int * |
| ) |  |

## __ieee754_hypot()

double __ieee754_hypot | ( | double | ,
|  | double |
| ) |  |

## __ieee754_j0()

double __ieee754_j0 | ( | double |  | ) |

## __ieee754_j1()

double __ieee754_j1 | ( | double |  | ) |

## __ieee754_jn()

double __ieee754_jn | ( | int | ,
|  | double |
| ) |  |

## __ieee754_lgamma()

double __ieee754_lgamma | ( | double |  | ) |

## __ieee754_lgamma_r()

double __ieee754_lgamma_r | ( | double | ,
|  | int * |
| ) |  |

## __ieee754_log()

double __ieee754_log | ( | double |  | ) |

Definition at line 85 of file e_log.c.

{
double hfsq,f,s,z,R,w,t1,t2,dk;
int32_t k,hx,i,j;
u_int32_t lx;
EXTRACT_WORDS(hx,lx,x);
k=0;
if (hx < 0x00100000) { /* x < 2**-1022 */
if (((hx&0x7fffffff)|lx)==0)
return -two54/zero; /* log(+-0)=-inf */
if (hx<0) return (x-x)/zero; /* log(-#) = NaN */
k -= 54; x *= two54; /* subnormal number, scale up x */
GET_HIGH_WORD(hx,x);
}
if (hx >= 0x7ff00000) return x+x;
k += (hx>>20)-1023;
hx &= 0x000fffff;
i = (hx+0x95f64)&0x100000;
SET_HIGH_WORD(x,hx|(i^0x3ff00000)); /* normalize x or x/2 */
k += (i>>20);
f = x-1.0;
if((0x000fffff&(2+hx))<3) { /* |f| < 2**-20 */
if(f==zero) {if(k==0) return zero; else {dk=(double)k;
return dk*ln2_hi+dk*ln2_lo;}
}
R = f*f*(0.5-0.33333333333333333*f);
if(k==0) return f-R; else {dk=(double)k;
return dk*ln2_hi-((R-dk*ln2_lo)-f);}
}
s = f/(2.0+f);
dk = (double)k;
z = s*s;
i = hx-0x6147a;
w = z*z;
j = 0x6b851-hx;
t1= w*(Lg2+w*(Lg4+w*Lg6));
t2= z*(Lg1+w*(Lg3+w*(Lg5+w*Lg7)));
i |= j;
R = t2+t1;
if(i>0) {
hfsq=0.5*f*f;
if(k==0) return f-(hfsq-s*(hfsq+R)); else
return dk*ln2_hi-((hfsq-(s*(hfsq+R)+dk*ln2_lo))-f);
} else {
if(k==0) return f-s*(f-R); else
return dk*ln2_hi-((s*(f-R)-dk*ln2_lo)-f);
}
}

References EXTRACT_WORDS, GET_HIGH_WORD, i, j, k, Lg1, Lg2, Lg3, Lg4, Lg5, Lg6, Lg7, ln2_hi, ln2_lo, SET_HIGH_WORD, two54, and zero.

## __ieee754_log10()

double __ieee754_log10 | ( | double |  | ) |

Definition at line 61 of file e_log10.c.

{
double y,z;
int32_t i,k,hx;
u_int32_t lx;
EXTRACT_WORDS(hx,lx,x);
k=0;
if (hx < 0x00100000) { /* x < 2**-1022 */
if (((hx&0x7fffffff)|lx)==0)
return -two54/zero; /* log(+-0)=-inf */
if (hx<0) return (x-x)/zero; /* log(-#) = NaN */
k -= 54; x *= two54; /* subnormal number, scale up x */
GET_HIGH_WORD(hx,x);
}
if (hx >= 0x7ff00000) return x+x;
k += (hx>>20)-1023;
i = ((u_int32_t)k&0x80000000)>>31;
hx = (hx&0x000fffff)|((0x3ff-i)<<20);
y = (double)(k+i);
SET_HIGH_WORD(x,hx);
z = y*log10_2lo + ivln10*__ieee754_log(x);
return z+y*log10_2hi;
}

References __ieee754_log, EXTRACT_WORDS, GET_HIGH_WORD, i, ivln10, k, log10_2hi, log10_2lo, SET_HIGH_WORD, two54, and zero.

## __ieee754_pow()

double __ieee754_pow | ( | double | ,
|  | double |
| ) |  |

Definition at line 103 of file e_pow.c.

{
double z,ax,z_h,z_l,p_h,p_l;
double y1,t1,t2,r,s,t,u,v,w;
int32_t i,j,k,yisint,n;
int32_t hx,hy,ix,iy;
u_int32_t lx,ly;
EXTRACT_WORDS(hx,lx,x);
/* x==1: 1**y = 1 (even if y is NaN) */
if (hx==0x3ff00000 && lx==0) {
return x;
}
ix = hx&0x7fffffff;
EXTRACT_WORDS(hy,ly,y);
iy = hy&0x7fffffff;
/* y==zero: x**0 = 1 */
if((iy|ly)==0) return one;
/* +-NaN return x+y */
if(ix > 0x7ff00000 || ((ix==0x7ff00000)&&(lx!=0)) ||
iy > 0x7ff00000 || ((iy==0x7ff00000)&&(ly!=0)))
return x+y;
/* determine if y is an odd int when x < 0
* yisint = 0 ... y is not an integer
* yisint = 1 ... y is an odd int
* yisint = 2 ... y is an even int
*/
yisint = 0;
if(hx<0) {
if(iy>=0x43400000) yisint = 2; /* even integer y */
else if(iy>=0x3ff00000) {
k = (iy>>20)-0x3ff; /* exponent */
if(k>20) {
j = ly>>(52-k);
if((j<<(52-k))==ly) yisint = 2-(j&1);
} else if(ly==0) {
j = iy>>(20-k);
if((j<<(20-k))==iy) yisint = 2-(j&1);
}
}
}
/* special value of y */
if(ly==0) {
if (iy==0x7ff00000) { /* y is +-inf */
if (((ix-0x3ff00000)|lx)==0)
return one; /* +-1**+-inf is 1 (yes, weird rule) */
if (ix >= 0x3ff00000) /* (|x|>1)**+-inf = inf,0 */
return (hy>=0) ? y : zero;
/* (|x|<1)**-,+inf = inf,0 */
return (hy<0) ? -y : zero;
}
if(iy==0x3ff00000) { /* y is +-1 */
if(hy<0) return one/x; else return x;
}
if(hy==0x40000000) return x*x; /* y is 2 */
if(hy==0x3fe00000) { /* y is 0.5 */
if(hx>=0) /* x >= +0 */
return __ieee754_sqrt(x);
}
}
ax = fabs(x);
/* special value of x */
if(lx==0) {
if(ix==0x7ff00000||ix==0||ix==0x3ff00000){
z = ax; /*x is +-0,+-inf,+-1*/
if(hy<0) z = one/z; /* z = (1/|x|) */
if(hx<0) {
if(((ix-0x3ff00000)|yisint)==0) {
z = (z-z)/(z-z); /* (-1)**non-int is NaN */
} else if(yisint==1)
z = -z; /* (x<0)**odd = -(|x|**odd) */
}
return z;
}
}
/* (x<0)**(non-int) is NaN */
if(((((u_int32_t)hx>>31)-1)|yisint)==0) return (x-x)/(x-x);
/* |y| is huge */
if(iy>0x41e00000) { /* if |y| > 2**31 */
if(iy>0x43f00000){ /* if |y| > 2**64, must o/uflow */
if(ix<=0x3fefffff) return (hy<0)? huge*huge:tiny*tiny;
if(ix>=0x3ff00000) return (hy>0)? huge*huge:tiny*tiny;
}
/* over/underflow if x is not close to one */
if(ix<0x3fefffff) return (hy<0)? huge*huge:tiny*tiny;
if(ix>0x3ff00000) return (hy>0)? huge*huge:tiny*tiny;
/* now |1-x| is tiny <= 2**-20, suffice to compute
log(x) by x-x^2/2+x^3/3-x^4/4 */
t = x-1; /* t has 20 trailing zeros */
w = (t*t)*(0.5-t*(0.3333333333333333333333-t*0.25));
u = ivln2_h*t; /* ivln2_h has 21 sig. bits */
v = t*ivln2_l-w*ivln2;
t1 = u+v;
SET_LOW_WORD(t1,0);
t2 = v-(t1-u);
} else {
double s2,s_h,s_l,t_h,t_l;
n = 0;
/* take care subnormal number */
if(ix<0x00100000)
{ax *= two53; n -= 53; GET_HIGH_WORD(ix,ax); }
n += ((ix)>>20)-0x3ff;
j = ix&0x000fffff;
/* determine interval */
ix = j|0x3ff00000; /* normalize ix */
if(j<=0x3988E) k=0; /* |x|<sqrt(3/2) */
else if(j<0xBB67A) k=1; /* |x|<sqrt(3) */
else {k=0;n+=1;ix -= 0x00100000;}
SET_HIGH_WORD(ax,ix);
/* compute s = s_h+s_l = (x-1)/(x+1) or (x-1.5)/(x+1.5) */
u = ax-bp[k]; /* bp[0]=1.0, bp[1]=1.5 */
v = one/(ax+bp[k]);
s = u*v;
s_h = s;
SET_LOW_WORD(s_h,0);
/* t_h=ax+bp[k] High */
t_h = zero;
SET_HIGH_WORD(t_h,((ix>>1)|0x20000000)+0x00080000+(k<<18));
t_l = ax - (t_h-bp[k]);
s_l = v*((u-s_h*t_h)-s_h*t_l);
/* compute log(ax) */
s2 = s*s;
r = s2*s2*(L1+s2*(L2+s2*(L3+s2*(L4+s2*(L5+s2*L6)))));
r += s_l*(s_h+s);
s2 = s_h*s_h;
t_h = 3.0+s2+r;
SET_LOW_WORD(t_h,0);
t_l = r-((t_h-3.0)-s2);
/* u+v = s*(1+...) */
u = s_h*t_h;
v = s_l*t_h+t_l*s;
/* 2/(3log2)*(s+...) */
p_h = u+v;
SET_LOW_WORD(p_h,0);
p_l = v-(p_h-u);
z_h = cp_h*p_h; /* cp_h+cp_l = 2/(3*log2) */
z_l = cp_l*p_h+p_l*cp+dp_l[k];
/* log2(ax) = (s+..)*2/(3*log2) = n + dp_h + z_h + z_l */
t = (double)n;
t1 = (((z_h+z_l)+dp_h[k])+t);
SET_LOW_WORD(t1,0);
t2 = z_l-(((t1-t)-dp_h[k])-z_h);
}
s = one; /* s (sign of result -ve**odd) = -1 else = 1 */
if(((((u_int32_t)hx>>31)-1)|(yisint-1))==0)
s = -one;/* (-ve)**(odd int) */
/* split up y into y1+y2 and compute (y1+y2)*(t1+t2) */
y1 = y;
SET_LOW_WORD(y1,0);
p_l = (y-y1)*t1+y*t2;
p_h = y1*t1;
z = p_l+p_h;
EXTRACT_WORDS(j,i,z);
if (j>=0x40900000) { /* z >= 1024 */
if(((j-0x40900000)|i)!=0) /* if z > 1024 */
return s*huge*huge; /* overflow */
else {
if(p_l+ovt>z-p_h) return s*huge*huge; /* overflow */
}
} else if((j&0x7fffffff)>=0x4090cc00 ) { /* z <= -1075 */
if(((j-0xc090cc00)|i)!=0) /* z < -1075 */
return s*tiny*tiny; /* underflow */
else {
if(p_l<=z-p_h) return s*tiny*tiny; /* underflow */
}
}
/*
* compute 2**(p_h+p_l)
*/
i = j&0x7fffffff;
k = (i>>20)-0x3ff;
n = 0;
if(i>0x3fe00000) { /* if |z| > 0.5, set n = [z+0.5] */
n = j+(0x00100000>>(k+1));
k = ((n&0x7fffffff)>>20)-0x3ff; /* new k for n */
t = zero;
SET_HIGH_WORD(t,n&~(0x000fffff>>k));
n = ((n&0x000fffff)|0x00100000)>>(20-k);
if(j<0) n = -n;
p_h -= t;
}
t = p_l+p_h;
SET_LOW_WORD(t,0);
u = t*lg2_h;
v = (p_l-(t-p_h))*lg2+t*lg2_l;
z = u+v;
w = v-(z-u);
t = z*z;
t1 = z - t*(P1+t*(P2+t*(P3+t*(P4+t*P5))));
r = (z*t1)/(t1-two)-(w+z*w);
z = one-(r-z);
GET_HIGH_WORD(j,z);
j += (n<<20);
if((j>>20)<=0) z = scalbn(z,n); /* subnormal output */
else SET_HIGH_WORD(z,j);
return s*z;
}

References __ieee754_sqrt, bp, cp, cp_h, cp_l, dp_h, dp_l, EXTRACT_WORDS, fabs(), GET_HIGH_WORD, huge, i, ivln2, ivln2_h, ivln2_l, j, k, L1, L2, L3, L4, L5, L6, lg2, lg2_h, lg2_l, one, ovt, P1, P2, P3, P4, P5, scalbn, SET_HIGH_WORD, SET_LOW_WORD, tiny, two, two53, and zero.

## __ieee754_rem_pio2()

int32_t __ieee754_rem_pio2 | ( | double | ,
|  | double * |
| ) |  |

Definition at line 69 of file e_rem_pio2.c.

{
double z=0.0,w,t,r,fn;
double tx[3];
int32_t e0,i,j,nx,n,ix,hx;
u_int32_t low;
GET_HIGH_WORD(hx,x); /* high word of x */
ix = hx&0x7fffffff;
if(ix<=0x3fe921fb) /* |x| ~<= pi/4 , no need for reduction */
{y[0] = x; y[1] = 0; return 0;}
if(ix<0x4002d97c) { /* |x| < 3pi/4, special case with n=+-1 */
if(hx>0) {
z = x - pio2_1;
if(ix!=0x3ff921fb) { /* 33+53 bit pi is good enough */
y[0] = z - pio2_1t;
y[1] = (z-y[0])-pio2_1t;
} else { /* near pi/2, use 33+33+53 bit pi */
z -= pio2_2;
y[0] = z - pio2_2t;
y[1] = (z-y[0])-pio2_2t;
}
return 1;
} else { /* negative x */
z = x + pio2_1;
if(ix!=0x3ff921fb) { /* 33+53 bit pi is good enough */
y[0] = z + pio2_1t;
y[1] = (z-y[0])+pio2_1t;
} else { /* near pi/2, use 33+33+53 bit pi */
z += pio2_2;
y[0] = z + pio2_2t;
y[1] = (z-y[0])+pio2_2t;
}
return -1;
}
}
if(ix<=0x413921fb) { /* |x| ~<= 2^19*(pi/2), medium size */
t = fabs(x);
n = (int32_t) (t*invpio2+half);
fn = (double)n;
r = t-fn*pio2_1;
w = fn*pio2_1t; /* 1st round good to 85 bit */
if(n<32&&ix!=npio2_hw[n-1]) {
y[0] = r-w; /* quick check no cancellation */
} else {
u_int32_t high;
j = ix>>20;
y[0] = r-w;
GET_HIGH_WORD(high,y[0]);
i = j-((high>>20)&0x7ff);
if(i>16) { /* 2nd iteration needed, good to 118 */
t = r;
w = fn*pio2_2;
r = t-w;
w = fn*pio2_2t-((t-r)-w);
y[0] = r-w;
GET_HIGH_WORD(high,y[0]);
i = j-((high>>20)&0x7ff);
if(i>49) { /* 3rd iteration need, 151 bits acc */
t = r; /* will cover all possible cases */
w = fn*pio2_3;
r = t-w;
w = fn*pio2_3t-((t-r)-w);
y[0] = r-w;
}
}
}
y[1] = (r-y[0])-w;
if(hx<0) {y[0] = -y[0]; y[1] = -y[1]; return -n;}
else return n;
}
/*
* all other (large) arguments
*/
if(ix>=0x7ff00000) { /* x is inf or NaN */
y[0]=y[1]=x-x; return 0;
}
/* set z = scalbn(|x|,ilogb(x)-23) */
GET_LOW_WORD(low,x);
SET_LOW_WORD(z,low);
e0 = (ix>>20)-1046; /* e0 = ilogb(z)-23; */
SET_HIGH_WORD(z, ix - ((int32_t)(e0<<20)));
for(i=0;i<2;i++) {
tx[i] = (double)((int32_t)(z));
z = (z-tx[i])*two24;
}
tx[2] = z;
nx = 3;
while((nx > 0) && tx[nx-1]==zero) nx--; /* skip zero term */
n = __kernel_rem_pio2(tx,y,e0,nx,2,two_over_pi);
if(hx<0) {y[0] = -y[0]; y[1] = -y[1]; return -n;}
return n;
}

References __kernel_rem_pio2(), fabs(), GET_HIGH_WORD, GET_LOW_WORD, half, i, invpio2, j, npio2_hw, pio2_1, pio2_1t, pio2_2, pio2_2t, pio2_3, pio2_3t, SET_HIGH_WORD, SET_LOW_WORD, two24, two_over_pi, and zero.

Referenced by cos(), sin(), and tan().

## __ieee754_remainder()

double __ieee754_remainder | ( | double | ,
|  | double |
| ) |  |

## __ieee754_scalb()

double __ieee754_scalb | ( | double | ,
|  | double |
| ) |  |

## __ieee754_sinh()

double __ieee754_sinh | ( | double |  | ) |

## __ieee754_sqrt()

double __ieee754_sqrt | ( | double |  | ) |

Definition at line 87 of file e_sqrt.c.

{
double z;
int32_t sign = (int)0x80000000;
int32_t ix0,s0,q,m,t,i;
u_int32_t r,t1,s1,ix1,q1;
EXTRACT_WORDS(ix0,ix1,x);
/* take care of Inf and NaN */
if((ix0&0x7ff00000)==0x7ff00000) {
return x*x+x; /* sqrt(NaN)=NaN, sqrt(+inf)=+inf
sqrt(-inf)=sNaN */
}
/* take care of zero */
if(ix0<=0) {
if(((ix0&(~sign))|ix1)==0) return x;/* sqrt(+-0) = +-0 */
else if(ix0<0)
return (x-x)/(x-x); /* sqrt(-ve) = sNaN */
}
/* normalize x */
m = (ix0>>20);
if(m==0) { /* subnormal x */
while(ix0==0) {
m -= 21;
ix0 |= (ix1>>11); ix1 <<= 21;
}
for(i=0;(ix0&0x00100000)==0;i++) ix0<<=1;
m -= i-1;
ix0 |= (ix1>>(32-i));
ix1 <<= i;
}
m -= 1023; /* unbias exponent */
ix0 = (ix0&0x000fffff)|0x00100000;
if(m&1){ /* odd m, double x to make it even */
ix0 += ix0 + ((ix1&sign)>>31);
ix1 += ix1;
}
m >>= 1; /* m = [m/2] */
/* generate sqrt(x) bit by bit */
ix0 += ix0 + ((ix1&sign)>>31);
ix1 += ix1;
q = q1 = s0 = s1 = 0; /* [q,q1] = sqrt(x) */
r = 0x00200000; /* r = moving bit from right to left */
while(r!=0) {
t = s0+r;
if(t<=ix0) {
s0 = t+r;
ix0 -= t;
q += r;
}
ix0 += ix0 + ((ix1&sign)>>31);
ix1 += ix1;
r>>=1;
}
r = sign;
while(r!=0) {
t1 = s1+r;
t = s0;
if((t<ix0)||((t==ix0)&&(t1<=ix1))) {
s1 = t1+r;
if(((t1&sign)==sign)&&(s1&sign)==0) s0 += 1;
ix0 -= t;
if (ix1 < t1) ix0 -= 1;
ix1 -= t1;
q1 += r;
}
ix0 += ix0 + ((ix1&sign)>>31);
ix1 += ix1;
r>>=1;
}
/* use floating add to find out rounding direction */
if((ix0|ix1)!=0) {
z = one-tiny; /* trigger inexact flag */
if (z>=one) {
z = one+tiny;
if (q1==(u_int32_t)0xffffffff) { q1=0; q += 1;}
else if (z>one) {
if (q1==(u_int32_t)0xfffffffe) q+=1;
q1+=2;
} else
q1 += (q1&1);
}
}
ix0 = (q>>1)+0x3fe00000;
ix1 = q1>>1;
if ((q&1)==1) ix1 |= sign;
ix0 += (m <<20);
INSERT_WORDS(z,ix0,ix1);
return z;
}

References EXTRACT_WORDS, i, INSERT_WORDS, one, and tiny.

## __ieee754_y0()

double __ieee754_y0 | ( | double |  | ) |

## __ieee754_y1()

double __ieee754_y1 | ( | double |  | ) |

## __ieee754_yn()

double __ieee754_yn | ( | int | ,
|  | double |
| ) |  |

## __kernel_cos()

double __kernel_cos | ( | double | ,
|  | double |
| ) |  |

Definition at line 59 of file k_cos.c.

{
double a,hz,z,r,qx;
int32_t ix;
GET_HIGH_WORD(ix,x);
ix &= 0x7fffffff; /* ix = |x|'s high word*/
if(ix<0x3e400000) { /* if x < 2**27 */
if(((int)x)==0) return one; /* generate inexact */
}
z = x*x;
r = z*(C1+z*(C2+z*(C3+z*(C4+z*(C5+z*C6)))));
if(ix < 0x3FD33333) /* if |x| < 0.3 */
return one - (0.5*z - (z*r - x*y));
else {
if(ix > 0x3fe90000) { /* x > 0.78125 */
qx = 0.28125;
} else {
INSERT_WORDS(qx,ix-0x00200000,0); /* x/4 */
}
hz = 0.5*z-qx;
a = one-qx;
return a - (hz - (z*r-x*y));
}
}

References C1, C2, C3, C4, C5, C6, GET_HIGH_WORD, INSERT_WORDS, and one.

Referenced by cos(), and sin().

## __kernel_rem_pio2()

int32_t __kernel_rem_pio2 | ( | double * | ,
|  | double * | ,
|  | int | ,
|  | int | ,
|  | const unsigned int | ,
|  | const int32_t * |
| ) |  |

Definition at line 152 of file k_rem_pio2.c.

{
int32_t jz,jx,jv,jp,jk,carry,n,iq[20],i,j,k,m,q0,ih;
double z,fw,f[20],fq[20],q[20];
if (nx < 1) {
return 0;
}
/* initialize jk*/
SDL_assert(prec < SDL_arraysize(init_jk));
jk = init_jk[prec];
SDL_assert(jk > 0);
jp = jk;
/* determine jx,jv,q0, note that 3>q0 */
jx = nx-1;
jv = (e0-3)/24; if(jv<0) jv=0;
q0 = e0-24*(jv+1);
/* set up f[0] to f[jx+jk] where f[jx+jk] = ipio2[jv+jk] */
j = jv-jx; m = jx+jk;
for(i=0;i<=m;i++,j++) f[i] = (j<0)? zero : (double) ipio2[j];
if ((m+1) < SDL_arraysize(f)) {
SDL_memset(&f[m+1], 0, sizeof (f) - ((m+1) * sizeof (f[0])));
}
/* compute q[0],q[1],...q[jk] */
for (i=0;i<=jk;i++) {
for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j];
q[i] = fw;
}
jz = jk;
recompute:
/* distill q[] into iq[] reversingly */
for(i=0,j=jz,z=q[jz];j>0;i++,j--) {
fw = (double)((int32_t)(twon24* z));
iq[i] = (int32_t)(z-two24*fw);
z = q[j-1]+fw;
}
if (jz < SDL_arraysize(iq)) {
SDL_memset(&iq[jz], 0, sizeof (q) - (jz * sizeof (iq[0])));
}
/* compute n */
z = scalbn(z,q0); /* actual value of z */
z -= 8.0*floor(z*0.125); /* trim off integer >= 8 */
n = (int32_t) z;
z -= (double)n;
ih = 0;
if(q0>0) { /* need iq[jz-1] to determine n */
i = (iq[jz-1]>>(24-q0)); n += i;
iq[jz-1] -= i<<(24-q0);
ih = iq[jz-1]>>(23-q0);
}
else if(q0==0) ih = iq[jz-1]>>23;
else if(z>=0.5) ih=2;
if(ih>0) { /* q > 0.5 */
n += 1; carry = 0;
for(i=0;i<jz ;i++) { /* compute 1-q */
j = iq[i];
if(carry==0) {
if(j!=0) {
carry = 1; iq[i] = 0x1000000- j;
}
} else iq[i] = 0xffffff - j;
}
if(q0>0) { /* rare case: chance is 1 in 12 */
switch(q0) {
case 1:
iq[jz-1] &= 0x7fffff; break;
case 2:
iq[jz-1] &= 0x3fffff; break;
}
}
if(ih==2) {
z = one - z;
if(carry!=0) z -= scalbn(one,q0);
}
}
/* check if recomputation is needed */
if(z==zero) {
j = 0;
for (i=jz-1;i>=jk;i--) j |= iq[i];
if(j==0) { /* need recomputation */
for(k=1;iq[jk-k]==0;k++); /* k = no. of terms needed */
for(i=jz+1;i<=jz+k;i++) { /* add q[jz+1] to q[jz+k] */
f[jx+i] = (double) ipio2[jv+i];
for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j];
q[i] = fw;
}
jz += k;
goto recompute;
}
}
/* chop off zero terms */
if(z==0.0) {
jz -= 1; q0 -= 24;
SDL_assert(jz >= 0);
while(iq[jz]==0) { jz--; SDL_assert(jz >= 0); q0-=24;}
} else { /* break z into 24-bit if necessary */
z = scalbn(z,-q0);
if(z>=two24) {
fw = (double)((int32_t)(twon24*z));
iq[jz] = (int32_t)(z-two24*fw);
jz += 1; q0 += 24;
iq[jz] = (int32_t) fw;
} else iq[jz] = (int32_t) z ;
}
/* convert integer "bit" chunk to floating-point value */
fw = scalbn(one,q0);
for(i=jz;i>=0;i--) {
q[i] = fw*(double)iq[i]; fw*=twon24;
}
/* compute PIo2[0,...,jp]*q[jz,...,0] */
for(i=jz;i>=0;i--) {
for(fw=0.0,k=0;k<=jp&&k<=jz-i;k++) fw += PIo2[k]*q[i+k];
fq[jz-i] = fw;
}
if ((jz+1) < SDL_arraysize(f)) {
SDL_memset(&fq[jz+1], 0, sizeof (fq) - ((jz+1) * sizeof (fq[0])));
}
/* compress fq[] into y[] */
switch(prec) {
case 0:
fw = 0.0;
for (i=jz;i>=0;i--) fw += fq[i];
y[0] = (ih==0)? fw: -fw;
break;
case 1:
case 2:
fw = 0.0;
for (i=jz;i>=0;i--) fw += fq[i];
y[0] = (ih==0)? fw: -fw;
fw = fq[0]-fw;
for (i=1;i<=jz;i++) fw += fq[i];
y[1] = (ih==0)? fw: -fw;
break;
case 3: /* painful */
for (i=jz;i>0;i--) {
fw = fq[i-1]+fq[i];
fq[i] += fq[i-1]-fw;
fq[i-1] = fw;
}
for (i=jz;i>1;i--) {
fw = fq[i-1]+fq[i];
fq[i] += fq[i-1]-fw;
fq[i-1] = fw;
}
for (fw=0.0,i=jz;i>=2;i--) fw += fq[i];
if(ih==0) {
y[0] = fq[0]; y[1] = fq[1]; y[2] = fw;
} else {
y[0] = -fq[0]; y[1] = -fq[1]; y[2] = -fw;
}
}
return n&7;
}

References floor(), i, init_jk, j, k, one, PIo2, scalbn, SDL_arraysize, SDL_assert, SDL_memset, two24, twon24, and zero.

Referenced by __ieee754_rem_pio2().

## __kernel_sin()

double __kernel_sin | ( | double | ,
|  | double | ,
|  | int |
| ) |  |

Definition at line 52 of file k_sin.c.

{
double z,r,v;
int32_t ix;
GET_HIGH_WORD(ix,x);
ix &= 0x7fffffff; /* high word of x */
if(ix<0x3e400000) /* |x| < 2**-27 */
{if((int)x==0) return x;} /* generate inexact */
z = x*x;
v = z*x;
r = S2+z*(S3+z*(S4+z*(S5+z*S6)));
if(iy==0) return x+v*(S1+z*r);
else return x-((z*(half*y-v*r)-y)-v*S1);
}

References GET_HIGH_WORD, half, S1, S2, S3, S4, S5, and S6.

Referenced by cos(), and sin().

## __kernel_tan()

double __kernel_tan | ( | double | ,
|  | double | ,
|  | int |
| ) |  |

Definition at line 69 of file k_tan.c.

{
double z,r,v,w,s;
int32_t ix,hx;
GET_HIGH_WORD(hx,x);
ix = hx&0x7fffffff; /* high word of |x| */
if(ix<0x3e300000) /* x < 2**-28 */
{if((int)x==0) { /* generate inexact */
u_int32_t low;
GET_LOW_WORD(low,x);
if(((ix|low)|(iy+1))==0) return one/fabs(x);
else return (iy==1)? x: -one/x;
}
}
if(ix>=0x3FE59428) { /* |x|>=0.6744 */
if(hx<0) {x = -x; y = -y;}
z = pio4-x;
w = pio4lo-y;
x = z+w; y = 0.0;
}
z = x*x;
w = z*z;
/* Break x^5*(T[1]+x^2*T[2]+...) into
* x^5(T[1]+x^4*T[3]+...+x^20*T[11]) +
* x^5(x^2*(T[2]+x^4*T[4]+...+x^22*[T12]))
*/
r = T[1]+w*(T[3]+w*(T[5]+w*(T[7]+w*(T[9]+w*T[11]))));
v = z*(T[2]+w*(T[4]+w*(T[6]+w*(T[8]+w*(T[10]+w*T[12])))));
s = z*x;
r = y + z*(s*(r+v)+y);
r += T[0]*s;
w = x+r;
if(ix>=0x3FE59428) {
v = (double)iy;
return (double)(1-((hx>>30)&2))*(v-2.0*(x-(w*w/(w+v)-r)));
}
if(iy==1) return w;
else { /* if allow error up to 2 ulp,
simply return -1.0/(x+r) here */
/* compute -1.0/(x+r) accurately */
double a,t;
z = w;
SET_LOW_WORD(z,0);
v = r-(z - x); /* z+v = r+x */
t = a = -1.0/w; /* a = -1.0/w */
SET_LOW_WORD(t,0);
s = 1.0+t*z;
return t+a*(s+t*v);
}
}

References fabs(), GET_HIGH_WORD, GET_LOW_WORD, one, pio4, pio4lo, SET_LOW_WORD, and T.

Referenced by tan().

two54
static const double two54
Definition: e_log10.c:54
ivln10
static const double ivln10
Definition: e_log10.c:55
P2
static const double P2
Definition: e_exp.c:95
SDL_memset
#define SDL_memset
Definition: SDL_dynapi_overrides.h:386
c
const GLubyte * c
Definition: SDL_opengl_glext.h:11093
bp
static const double bp[]
Definition: e_pow.c:71
ivln2_l
static const double ivln2_l
Definition: e_pow.c:101
one
static const double one
Definition: k_rem_pio2.c:148
pi_o_2
static const double pi_o_2
Definition: e_atan2.c:46
t1
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t1
Definition: SDL_opengl_glext.h:8583
fabs
double fabs(double x)
Definition: s_fabs.c:22
Lg1
static const double Lg1
Definition: e_log.c:75
P4
static const double P4
Definition: e_exp.c:97
two
static const double two
Definition: e_pow.c:76
pi_o_4
static const double pi_o_4
Definition: e_atan2.c:45
zero
static const double zero
Definition: k_rem_pio2.c:147
Zero
static const double Zero[]
Definition: e_fmod.c:21
huge
static const double huge
Definition: e_exp.c:85
zero
static const double zero
Definition: e_rem_pio2.c:58
cp
static const double cp
Definition: e_pow.c:96
S4
static const double S4
Definition: k_sin.c:48
L5
static const double L5
Definition: e_pow.c:85
two24
static const double two24
Definition: e_rem_pio2.c:60
pio4
static const double pio4
Definition: k_tan.c:51
C3
static const double C3
Definition: k_cos.c:54
q
GLdouble GLdouble GLdouble GLdouble q
Definition: SDL_opengl.h:2087
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
P5
static const double P5
Definition: e_pow.c:91
pio2_2t
static const double pio2_2t
Definition: e_rem_pio2.c:65
pi
static const double pi
Definition: e_atan2.c:47
z
GLdouble GLdouble z
Definition: SDL_opengl_glext.h:404
pio2_1
static const double pio2_1
Definition: e_rem_pio2.c:62
log10_2hi
static const double log10_2hi
Definition: e_log10.c:56
Lg7
static const double Lg7
Definition: e_log.c:81
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1109
v
const GLdouble * v
Definition: SDL_opengl.h:2064
__ieee754_sqrt
#define __ieee754_sqrt
Definition: math_private.h:48
lg2_h
static const double lg2_h
Definition: e_pow.c:93
zero
static const double zero
Definition: e_pow.c:74
one
static const double one
Definition: k_tan.c:50
tiny
static const double tiny
Definition: e_sqrt.c:85
EXTRACT_WORDS
#define EXTRACT_WORDS(ix0, ix1, d)
Definition: math_private.h:99
o_threshold
static const double o_threshold
Definition: e_exp.c:87
n
GLdouble n
Definition: SDL_opengl_glext.h:1952
Lg2
static const double Lg2
Definition: e_log.c:76
s1
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s1
Definition: SDL_opengl_glext.h:8583
L4
static const double L4
Definition: e_pow.c:84
L2
static const double L2
Definition: e_pow.c:82
SET_HIGH_WORD
#define SET_HIGH_WORD(d, v)
Definition: math_private.h:137
log10_2lo
static const double log10_2lo
Definition: e_log10.c:57
half
static const double half
Definition: k_sin.c:44
zero
static const double zero
Definition: e_log.c:83
scalbn
#define scalbn
Definition: math_private.h:46
zero
static const double zero
Definition: e_log10.c:59
invpio2
static const double invpio2
Definition: e_rem_pio2.c:61
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
s0
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s0
Definition: SDL_opengl_glext.h:8583
huge
static const double huge
Definition: e_pow.c:78
u_threshold
static const double u_threshold
Definition: e_exp.c:88
SET_LOW_WORD
#define SET_LOW_WORD(d, v)
Definition: math_private.h:147
one
static const double one
Definition: e_sqrt.c:85
int32_t
signed int int32_t
Definition: SDL_config_windows.h:62
u_int32_t
unsigned int u_int32_t
Definition: math_private.h:31
cp_h
static const double cp_h
Definition: e_pow.c:97
f
GLfloat f
Definition: SDL_opengl_glext.h:1870
t
GLdouble GLdouble t
Definition: SDL_opengl.h:2071
lg2_l
static const double lg2_l
Definition: e_pow.c:94
INSERT_WORDS
#define INSERT_WORDS(d, ix0, ix1)
Definition: math_private.h:127
Lg5
static const double Lg5
Definition: e_log.c:79
ln2HI
static const double ln2HI[2]
Definition: e_exp.c:89
nx
GLbyte nx
Definition: SDL_opengl_glext.h:5713
pio2_3
static const double pio2_3
Definition: e_rem_pio2.c:66
k
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int int int return Display Window Cursor return Display Window return Display Drawable GC int int unsigned int unsigned int return Display Drawable GC int int _Xconst char int return Display Drawable GC int int unsigned int unsigned int return Display return Display Cursor return Display GC return XModifierKeymap return char Display Window int return Display return Display Atom return Display Window XWindowAttributes return Display Window return Display XEvent Bool(*) XPointer return Display Window Bool unsigned int int int Window Cursor Time return Display Window int return KeySym return Display _Xconst char Bool return Display _Xconst char return XKeyEvent char int KeySym XComposeStatus return Display int int int XVisualInfo return Display Window int int return _Xconst char return Display XEvent return Display Drawable GC XImage int int int int unsigned int unsigned int return Display Window Window Window int int int int unsigned int return Display Window Window int int return Display Window unsigned int unsigned int return Display Window Bool long XEvent return Display GC unsigned long return Display Window int Time return Display Window Window return Display Window unsigned long return Display Window XSizeHints Display Colormap XColor int return char int XTextProperty return XFontStruct _Xconst char int int int int XCharStruct return Display Window return Display Time return Display Colormap return Display Window Window int int unsigned int unsigned int int int return Display Window int return XExtensionInfo Display char XExtensionHooks int XPointer return XExtensionInfo XExtensionInfo Display return Display return Display unsigned long Display GC Display char long Display xReply int Bool return Display Bool return Display int SDL_X11_XESetEventToWireRetType return Display Window Window Window Window unsigned int return Display XShmSegmentInfo return Display Drawable GC XImage int int int int unsigned int unsigned int Boo k)
Definition: SDL_x11sym.h:213
ln2_lo
static const double ln2_lo
Definition: e_log.c:73
C6
static const double C6
Definition: k_cos.c:57
pio2_2
static const double pio2_2
Definition: e_rem_pio2.c:64
pio2_3t
static const double pio2_3t
Definition: e_rem_pio2.c:67
S5
static const double S5
Definition: k_sin.c:49
ivln2
static const double ivln2
Definition: e_pow.c:99
P1
static const double P1
Definition: e_exp.c:94
SDL_assert
#define SDL_assert(condition)
Definition: SDL_assert.h:169
dp_h
static const double dp_h[]
Definition: e_pow.c:72
P2
static const double P2
Definition: e_pow.c:88
tiny
static const double tiny
Definition: e_pow.c:79
tiny
static const double tiny
Definition: e_atan2.c:43
one
static const double one
Definition: e_fmod.c:21
C1
static const double C1
Definition: k_cos.c:52
pio4lo
static const double pio4lo
Definition: k_tan.c:52
y
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
S3
static const double S3
Definition: k_sin.c:47
two_over_pi
static const int32_t two_over_pi[]
Definition: e_rem_pio2.c:24
twom1000
static const double twom1000
Definition: e_exp.c:86
P4
static const double P4
Definition: e_pow.c:90
SDL_arraysize
#define SDL_arraysize(array)
Definition: SDL_stdinc.h:115
m
const GLfloat * m
Definition: SDL_opengl_glext.h:6092
atan
double atan(double x)
Definition: s_atan.c:71
P5
static const double P5
Definition: e_exp.c:98
P3
static const double P3
Definition: e_exp.c:96
dp_l
static const double dp_l[]
Definition: e_pow.c:73
L3
static const double L3
Definition: e_pow.c:83
P1
static const double P1
Definition: e_pow.c:87
s
GLdouble s
Definition: SDL_opengl.h:2063
j
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int int in j)
Definition: SDL_x11sym.h:50
C2
static const double C2
Definition: k_cos.c:53
y1
GLfixed y1
Definition: SDL_opengl_glext.h:4583
GET_LOW_WORD
#define GET_LOW_WORD(i, d)
Definition: math_private.h:118
zero
static const double zero
Definition: e_atan2.c:44
two53
static const double two53
Definition: e_pow.c:77
Lg6
static const double Lg6
Definition: e_log.c:80
ivln2_h
static const double ivln2_h
Definition: e_pow.c:100
two54
static const double two54
Definition: e_log.c:74
L1
static const double L1
Definition: e_pow.c:81
lg2
static const double lg2
Definition: e_pow.c:92
two24
static const double two24
Definition: k_rem_pio2.c:149
invln2
static const double invln2
Definition: e_exp.c:93
L6
static const double L6
Definition: e_pow.c:86
halF
static const double halF[2]
Definition: e_exp.c:84
ln2LO
static const double ln2LO[2]
Definition: e_exp.c:91
C4
static const double C4
Definition: k_cos.c:55
init_jk
static const int init_jk[]
Definition: k_rem_pio2.c:133
GET_HIGH_WORD
#define GET_HIGH_WORD(i, d)
Definition: math_private.h:109
half
static const double half
Definition: e_rem_pio2.c:59
pi_lo
static const double pi_lo
Definition: e_atan2.c:48
one
static const double one
Definition: k_cos.c:51
one
static const double one
Definition: e_pow.c:75
Lg4
static const double Lg4
Definition: e_log.c:78
P3
static const double P3
Definition: e_pow.c:89
__ieee754_log
#define __ieee754_log
Definition: math_private.h:42
T
static const double T[]
Definition: k_tan.c:53
floor
double floor(double x)
Definition: s_floor.c:33
S6
static const double S6
Definition: k_sin.c:50
ln2_hi
static const double ln2_hi
Definition: e_log.c:72
S2
static const double S2
Definition: k_sin.c:46
S1
static const double S1
Definition: k_sin.c:45
C5
static const double C5
Definition: k_cos.c:56
one
static const double one
Definition: e_exp.c:83
PIo2
static const double PIo2[]
Definition: k_rem_pio2.c:135
twon24
static const double twon24
Definition: k_rem_pio2.c:150
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:50
cp_l
static const double cp_l
Definition: e_pow.c:98
pio2_1t
static const double pio2_1t
Definition: e_rem_pio2.c:63
Lg3
static const double Lg3
Definition: e_log.c:77
ovt
static const double ovt
Definition: e_pow.c:95
__kernel_rem_pio2
int32_t attribute_hidden __kernel_rem_pio2(double *x, double *y, int e0, int nx, const unsigned int prec, const int32_t *ipio2)
Definition: k_rem_pio2.c:152
npio2_hw
static const int32_t npio2_hw[]
Definition: e_rem_pio2.c:38
d
const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char const char const SDL_SCANF_FORMAT_STRING char return SDL_ThreadFunction const char void return Uint32 return Uint32 SDL_AssertionHandler void SDL_SpinLock SDL_atomic_t int int return SDL_atomic_t return void void void return void return int return SDL_AudioSpec SDL_AudioSpec return int int return return int SDL_RWops int SDL_AudioSpec Uint8 ** d
Definition: SDL_dynapi_procs.h:117
w
GLubyte GLubyte GLubyte GLubyte w
Definition: SDL_opengl_glext.h:731