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 | 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
int | __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
int | __kernel_rem_pio2 (double *, double *, int, int, int, const int *) attribute_hidden

## Macro Definition Documentation

## __ieee754_atan2

#define __ieee754_atan2 SDL_uclibc_atan2

Definition at line 35 of file math_private.h.

## __ieee754_fmod

#define __ieee754_fmod SDL_uclibc_fmod

Definition at line 40 of file math_private.h.

## __ieee754_log

#define __ieee754_log SDL_uclibc_log

Definition at line 41 of file math_private.h.

Referenced by __ieee754_log10().

## __ieee754_log10

#define __ieee754_log10 SDL_uclibc_log10

Definition at line 42 of file math_private.h.

## __ieee754_pow

#define __ieee754_pow SDL_uclibc_pow

Definition at line 43 of file math_private.h.

## __ieee754_sqrt

#define __ieee754_sqrt SDL_uclibc_sqrt

Definition at line 47 of file math_private.h.

Referenced by __ieee754_pow().

## _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)
d
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const 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

Definition at line 98 of file math_private.h.

Referenced by __ieee754_atan2(), __ieee754_fmod(), __ieee754_log(), __ieee754_log10(), __ieee754_pow(), __ieee754_sqrt(), floor(), and scalbln().

## fabs

#define fabs SDL_uclibc_fabs

Definition at line 38 of file math_private.h.

## floor

#define floor SDL_uclibc_floor

Definition at line 39 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)
d
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const 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
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

Definition at line 165 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)
d
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const 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
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

Definition at line 108 of file math_private.h.

Referenced by __ieee754_atan2(), __ieee754_log(), __ieee754_log10(), __ieee754_pow(), __ieee754_rem_pio2(), __kernel_cos(), __kernel_sin(), __kernel_tan(), atan(), copysign(), cos(), fabs(), scalbln(), sin(), and tan().

## 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)
d
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const 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
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

Definition at line 117 of file math_private.h.

Referenced by __ieee754_rem_pio2(), __kernel_tan(), and atan().

## 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)
d
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const 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

Definition at line 126 of file math_private.h.

Referenced by __ieee754_fmod(), __ieee754_sqrt(), __kernel_cos(), and floor().

## 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 44 of file math_private.h.

## scalbn

#define scalbn SDL_uclibc_scalbn

Definition at line 45 of file math_private.h.

Referenced by __ieee754_pow(), __kernel_rem_pio2(), libm_hidden_def(), and SDL_scalbn().

## 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)
d
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const 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
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

Definition at line 174 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)
v
const GLdouble * v
Definition: SDL_opengl.h:2064
d
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const 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

Definition at line 136 of file math_private.h.

Referenced by __ieee754_atan2(), __ieee754_log(), __ieee754_log10(), __ieee754_pow(), __ieee754_rem_pio2(), copysign(), fabs(), and scalbln().

## 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)
v
const GLdouble * v
Definition: SDL_opengl.h:2064
d
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const 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

Definition at line 146 of file math_private.h.

Referenced by __ieee754_pow(), __ieee754_rem_pio2(), and __kernel_tan().

## sin

#define sin SDL_uclibc_sin

Definition at line 46 of file math_private.h.

## strong_alias

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

Definition at line 28 of file math_private.h.

Referenced by __ieee754_atan2(), __ieee754_fmod(), __ieee754_log(), __ieee754_log10(), __ieee754_pow(), and __ieee754_sqrt().

## tan

#define tan SDL_uclibc_tan

Definition at line 48 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.

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

Referenced by __ieee754_atan2().

{
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(-,-) */
}
}
GET_HIGH_WORD
#define GET_HIGH_WORD(i, d)
Definition: math_private.h:108
pi
static const double pi
Definition: e_atan2.c:47
z
GLdouble GLdouble z
Definition: SDL_opengl_glext.h:404
tiny
static const double tiny
Definition: e_atan2.c:43
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
int32_t
signed int int32_t
Definition: SDL_config_windows.h:62
m
const GLfloat * m
Definition: SDL_opengl_glext.h:6092
pi_o_4
static const double pi_o_4
Definition: e_atan2.c:45
SET_HIGH_WORD
#define SET_HIGH_WORD(d, v)
Definition: math_private.h:136
pi_lo
static const double pi_lo
Definition: e_atan2.c:48
zero
static const double zero
Definition: e_atan2.c:44
u_int32_t
unsigned int u_int32_t
Definition: math_private.h:31
EXTRACT_WORDS
#define EXTRACT_WORDS(ix0, ix1, d)
Definition: math_private.h:98
pi_o_2
static const double pi_o_2
Definition: e_atan2.c:46
y
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
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
atan
double atan(double x)
Definition: s_atan.c:67
fabs
double fabs(double x)
Definition: s_fabs.c:22

## __ieee754_atanh()

double __ieee754_atanh | ( | double |  | ) |

## __ieee754_cosh()

double __ieee754_cosh | ( | double |  | ) |

## __ieee754_exp()

double __ieee754_exp | ( | double |  | ) |

## __ieee754_fmod()

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

Definition at line 23 of file e_fmod.c.

References __ieee754_fmod(), EXTRACT_WORDS, i, INSERT_WORDS, libm_hidden_def(), one, strong_alias, and Zero.

Referenced by __ieee754_fmod().

{
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 */
}
Zero
static const double Zero[]
Definition: e_fmod.c:21
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
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
EXTRACT_WORDS
#define EXTRACT_WORDS(ix0, ix1, d)
Definition: math_private.h:98
INSERT_WORDS
#define INSERT_WORDS(d, ix0, ix1)
Definition: math_private.h:126
y
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
one
static const double one
Definition: e_fmod.c:21
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
n
GLdouble n
Definition: SDL_opengl_glext.h:1952

## __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.

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

Referenced by __ieee754_log().

{
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);
}
}
GET_HIGH_WORD
#define GET_HIGH_WORD(i, d)
Definition: math_private.h:108
Lg7
static const double Lg7
Definition: e_log.c:81
z
GLdouble GLdouble z
Definition: SDL_opengl_glext.h:404
s
GLdouble s
Definition: SDL_opengl.h:2063
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
int32_t
signed int int32_t
Definition: SDL_config_windows.h:62
two54
static const double two54
Definition: e_log.c:74
f
GLfloat f
Definition: SDL_opengl_glext.h:1870
Lg4
static const double Lg4
Definition: e_log.c:78
Lg3
static const double Lg3
Definition: e_log.c:77
SET_HIGH_WORD
#define SET_HIGH_WORD(d, v)
Definition: math_private.h:136
t1
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t1
Definition: SDL_opengl_glext.h:8583
u_int32_t
unsigned int u_int32_t
Definition: math_private.h:31
Lg6
static const double Lg6
Definition: e_log.c:80
EXTRACT_WORDS
#define EXTRACT_WORDS(ix0, ix1, d)
Definition: math_private.h:98
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
w
GLubyte GLubyte GLubyte GLubyte w
Definition: SDL_opengl_glext.h:731
ln2_hi
static const double ln2_hi
Definition: e_log.c:72
Lg2
static const double Lg2
Definition: e_log.c:76
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
zero
static const double zero
Definition: e_log.c:83
Lg1
static const double Lg1
Definition: e_log.c:75
ln2_lo
static const double ln2_lo
Definition: e_log.c:73
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
Lg5
static const double Lg5
Definition: e_log.c:79

## __ieee754_log10()

double __ieee754_log10 | ( | double |  | ) |

Definition at line 61 of file e_log10.c.

References __ieee754_log, __ieee754_log10(), EXTRACT_WORDS, GET_HIGH_WORD, i, ivln10, k, libm_hidden_def(), log10_2hi, log10_2lo, SET_HIGH_WORD, strong_alias, two54, and zero.

Referenced by __ieee754_log10().

{
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;
}
GET_HIGH_WORD
#define GET_HIGH_WORD(i, d)
Definition: math_private.h:108
__ieee754_log
#define __ieee754_log
Definition: math_private.h:41
z
GLdouble GLdouble z
Definition: SDL_opengl_glext.h:404
log10_2hi
static const double log10_2hi
Definition: e_log10.c:56
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
int32_t
signed int int32_t
Definition: SDL_config_windows.h:62
ivln10
static const double ivln10
Definition: e_log10.c:55
SET_HIGH_WORD
#define SET_HIGH_WORD(d, v)
Definition: math_private.h:136
u_int32_t
unsigned int u_int32_t
Definition: math_private.h:31
EXTRACT_WORDS
#define EXTRACT_WORDS(ix0, ix1, d)
Definition: math_private.h:98
log10_2lo
static const double log10_2lo
Definition: e_log10.c:57
y
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
zero
static const double zero
Definition: e_log10.c:59
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
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
two54
static const double two54
Definition: e_log10.c:54

## __ieee754_pow()

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

Definition at line 99 of file e_pow.c.

References __ieee754_pow(), __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, libm_hidden_def(), one, ovt, P1, P2, P3, P4, P5, scalbn, SET_HIGH_WORD, SET_LOW_WORD, strong_alias, tiny, two, two53, and zero.

Referenced by __ieee754_pow().

{
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;
}
GET_HIGH_WORD
#define GET_HIGH_WORD(i, d)
Definition: math_private.h:108
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
two53
static const double two53
Definition: e_pow.c:73
z
GLdouble GLdouble z
Definition: SDL_opengl_glext.h:404
dp_l
static const double dp_l[]
Definition: e_pow.c:69
s
GLdouble s
Definition: SDL_opengl.h:2063
v
const GLdouble * v
Definition: SDL_opengl.h:2064
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
int32_t
signed int int32_t
Definition: SDL_config_windows.h:62
ivln2_h
static const double ivln2_h
Definition: e_pow.c:96
P3
static const double P3
Definition: e_pow.c:85
L1
static const double L1
Definition: e_pow.c:77
L6
static const double L6
Definition: e_pow.c:82
lg2
static const double lg2
Definition: e_pow.c:88
lg2_l
static const double lg2_l
Definition: e_pow.c:90
ovt
static const double ovt
Definition: e_pow.c:91
tiny
static const double tiny
Definition: e_pow.c:75
bp
static const double bp[]
Definition: e_pow.c:67
__ieee754_sqrt
#define __ieee754_sqrt
Definition: math_private.h:47
SET_HIGH_WORD
#define SET_HIGH_WORD(d, v)
Definition: math_private.h:136
t1
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t1
Definition: SDL_opengl_glext.h:8583
scalbn
#define scalbn
Definition: math_private.h:45
dp_h
static const double dp_h[]
Definition: e_pow.c:68
y1
GLfixed y1
Definition: SDL_opengl_glext.h:4583
L3
static const double L3
Definition: e_pow.c:79
P1
static const double P1
Definition: e_pow.c:83
P4
static const double P4
Definition: e_pow.c:86
u_int32_t
unsigned int u_int32_t
Definition: math_private.h:31
L5
static const double L5
Definition: e_pow.c:81
two
static const double two
Definition: e_pow.c:72
SET_LOW_WORD
#define SET_LOW_WORD(d, v)
Definition: math_private.h:146
EXTRACT_WORDS
#define EXTRACT_WORDS(ix0, ix1, d)
Definition: math_private.h:98
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
one
static const double one
Definition: e_pow.c:71
w
GLubyte GLubyte GLubyte GLubyte w
Definition: SDL_opengl_glext.h:731
lg2_h
static const double lg2_h
Definition: e_pow.c:89
y
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
cp_l
static const double cp_l
Definition: e_pow.c:94
L2
static const double L2
Definition: e_pow.c:78
zero
static const double zero
Definition: e_pow.c:70
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
ivln2_l
static const double ivln2_l
Definition: e_pow.c:97
huge
static const double huge
Definition: e_pow.c:74
L4
static const double L4
Definition: e_pow.c:80
n
GLdouble n
Definition: SDL_opengl_glext.h:1952
cp
static const double cp
Definition: e_pow.c:92
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
cp_h
static const double cp_h
Definition: e_pow.c:93
ivln2
static const double ivln2
Definition: e_pow.c:95
P5
static const double P5
Definition: e_pow.c:87
P2
static const double P2
Definition: e_pow.c:84
fabs
double fabs(double x)
Definition: s_fabs.c:22
t
GLdouble GLdouble t
Definition: SDL_opengl.h:2071

## __ieee754_rem_pio2()

int __ieee754_rem_pio2 | ( | double | ,
|  | double * |
| ) |  |

Definition at line 69 of file e_rem_pio2.c.

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().

{
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(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;
}
GET_HIGH_WORD
#define GET_HIGH_WORD(i, d)
Definition: math_private.h:108
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
z
GLdouble GLdouble z
Definition: SDL_opengl_glext.h:404
invpio2
static const double invpio2
Definition: e_rem_pio2.c:61
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
int32_t
signed int int32_t
Definition: SDL_config_windows.h:62
pio2_1t
static const double pio2_1t
Definition: e_rem_pio2.c:63
pio2_3t
static const double pio2_3t
Definition: e_rem_pio2.c:67
SET_HIGH_WORD
#define SET_HIGH_WORD(d, v)
Definition: math_private.h:136
zero
static const double zero
Definition: e_rem_pio2.c:58
u_int32_t
unsigned int u_int32_t
Definition: math_private.h:31
SET_LOW_WORD
#define SET_LOW_WORD(d, v)
Definition: math_private.h:146
__kernel_rem_pio2
int attribute_hidden __kernel_rem_pio2(double *x, double *y, int e0, int nx, int prec, const int32_t *ipio2)
Definition: k_rem_pio2.c:150
half
static const double half
Definition: e_rem_pio2.c:59
two24
static const double two24
Definition: e_rem_pio2.c:60
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
nx
GLbyte nx
Definition: SDL_opengl_glext.h:5713
w
GLubyte GLubyte GLubyte GLubyte w
Definition: SDL_opengl_glext.h:731
y
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
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
npio2_hw
static const int32_t npio2_hw[]
Definition: e_rem_pio2.c:38
GET_LOW_WORD
#define GET_LOW_WORD(i, d)
Definition: math_private.h:117
n
GLdouble n
Definition: SDL_opengl_glext.h:1952
pio2_2
static const double pio2_2
Definition: e_rem_pio2.c:64
pio2_1
static const double pio2_1
Definition: e_rem_pio2.c:62
pio2_3
static const double pio2_3
Definition: e_rem_pio2.c:66
two_over_pi
static const int32_t two_over_pi[]
Definition: e_rem_pio2.c:24
fabs
double fabs(double x)
Definition: s_fabs.c:22
t
GLdouble GLdouble t
Definition: SDL_opengl.h:2071
pio2_2t
static const double pio2_2t
Definition: e_rem_pio2.c:65

## __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.

References __ieee754_sqrt(), EXTRACT_WORDS, i, INSERT_WORDS, libm_hidden_def(), one, strong_alias, and tiny.

Referenced by __ieee754_sqrt().

{
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;
}
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
z
GLdouble GLdouble z
Definition: SDL_opengl_glext.h:404
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
int32_t
signed int int32_t
Definition: SDL_config_windows.h:62
q
GLdouble GLdouble GLdouble GLdouble q
Definition: SDL_opengl.h:2087
tiny
static const double tiny
Definition: e_sqrt.c:85
m
const GLfloat * m
Definition: SDL_opengl_glext.h:6092
one
static const double one
Definition: e_sqrt.c:85
t1
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t1
Definition: SDL_opengl_glext.h:8583
u_int32_t
unsigned int u_int32_t
Definition: math_private.h:31
EXTRACT_WORDS
#define EXTRACT_WORDS(ix0, ix1, d)
Definition: math_private.h:98
INSERT_WORDS
#define INSERT_WORDS(d, ix0, ix1)
Definition: math_private.h:126
s1
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s1
Definition: SDL_opengl_glext.h:8583
s0
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s0
Definition: SDL_opengl_glext.h:8583
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
t
GLdouble GLdouble t
Definition: SDL_opengl.h:2071

## __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.

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

Referenced by cos(), and sin().

{
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));
}
}
GET_HIGH_WORD
#define GET_HIGH_WORD(i, d)
Definition: math_private.h:108
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
z
GLdouble GLdouble z
Definition: SDL_opengl_glext.h:404
C5
static const double C5
Definition: k_cos.c:56
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
int32_t
signed int int32_t
Definition: SDL_config_windows.h:62
C1
static const double C1
Definition: k_cos.c:52
C2
static const double C2
Definition: k_cos.c:53
C4
static const double C4
Definition: k_cos.c:55
C6
static const double C6
Definition: k_cos.c:57
INSERT_WORDS
#define INSERT_WORDS(d, ix0, ix1)
Definition: math_private.h:126
C3
static const double C3
Definition: k_cos.c:54
y
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
one
static const double one
Definition: k_cos.c:51
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1109

## __kernel_rem_pio2()

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

## __kernel_sin()

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

Definition at line 52 of file k_sin.c.

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

Referenced by cos(), and sin().

{
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);
}
GET_HIGH_WORD
#define GET_HIGH_WORD(i, d)
Definition: math_private.h:108
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
z
GLdouble GLdouble z
Definition: SDL_opengl_glext.h:404
S3
static const double S3
Definition: k_sin.c:47
v
const GLdouble * v
Definition: SDL_opengl.h:2064
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
int32_t
signed int int32_t
Definition: SDL_config_windows.h:62
S6
static const double S6
Definition: k_sin.c:50
S4
static const double S4
Definition: k_sin.c:48
half
static const double half
Definition: k_sin.c:44
y
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
S2
static const double S2
Definition: k_sin.c:46
S1
static const double S1
Definition: k_sin.c:45
S5
static const double S5
Definition: k_sin.c:49

## __kernel_tan()

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

Definition at line 69 of file k_tan.c.

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

Referenced by tan().

{
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);
}
}
GET_HIGH_WORD
#define GET_HIGH_WORD(i, d)
Definition: math_private.h:108
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
z
GLdouble GLdouble z
Definition: SDL_opengl_glext.h:404
s
GLdouble s
Definition: SDL_opengl.h:2063
pio4lo
static const double pio4lo
Definition: k_tan.c:52
v
const GLdouble * v
Definition: SDL_opengl.h:2064
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
int32_t
signed int int32_t
Definition: SDL_config_windows.h:62
T
static const double T[]
Definition: k_tan.c:53
u_int32_t
unsigned int u_int32_t
Definition: math_private.h:31
SET_LOW_WORD
#define SET_LOW_WORD(d, v)
Definition: math_private.h:146
w
GLubyte GLubyte GLubyte GLubyte w
Definition: SDL_opengl_glext.h:731
y
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
GET_LOW_WORD
#define GET_LOW_WORD(i, d)
Definition: math_private.h:117
pio4
static const double pio4
Definition: k_tan.c:51
one
static const double one
Definition: k_tan.c:50
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1109
fabs
double fabs(double x)
Definition: s_fabs.c:22
t
GLdouble GLdouble t
Definition: SDL_opengl.h:2071