SDL  2.0
k_sin.c File Reference
#include "math_libm.h"
#include "math_private.h"
+ Include dependency graph for k_sin.c:

Go to the source code of this file.

Functions

double attribute_hidden __kernel_sin (double x, double y, int iy)
 

Variables

static const double half = 5.00000000000000000000e-01
 
static const double S1 = -1.66666666666666324348e-01
 
static const double S2 = 8.33333333332248946124e-03
 
static const double S3 = -1.98412698298579493134e-04
 
static const double S4 = 2.75573137070700676789e-06
 
static const double S5 = -2.50507602534068634195e-08
 
static const double S6 = 1.58969099521155010221e-10
 

Function Documentation

◆ __kernel_sin()

double attribute_hidden __kernel_sin ( double  x,
double  y,
int  iy 
)

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

53 {
54  double z,r,v;
55  int32_t ix;
56  GET_HIGH_WORD(ix,x);
57  ix &= 0x7fffffff; /* high word of x */
58  if(ix<0x3e400000) /* |x| < 2**-27 */
59  {if((int)x==0) return x;} /* generate inexact */
60  z = x*x;
61  v = z*x;
62  r = S2+z*(S3+z*(S4+z*(S5+z*S6)));
63  if(iy==0) return x+v*(S1+z*r);
64  else return x-((z*(half*y-v*r)-y)-v*S1);
65 }
#define GET_HIGH_WORD(i, d)
Definition: math_private.h:108
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
GLdouble GLdouble z
static const double S3
Definition: k_sin.c:47
const GLdouble * v
Definition: SDL_opengl.h:2064
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
signed int int32_t
static const double S6
Definition: k_sin.c:50
static const double S4
Definition: k_sin.c:48
static const double half
Definition: k_sin.c:44
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
static const double S2
Definition: k_sin.c:46
static const double S1
Definition: k_sin.c:45
static const double S5
Definition: k_sin.c:49

Variable Documentation

◆ half

const double half = 5.00000000000000000000e-01
static

Definition at line 44 of file k_sin.c.

Referenced by __kernel_sin().

◆ S1

const double S1 = -1.66666666666666324348e-01
static

Definition at line 45 of file k_sin.c.

Referenced by __kernel_sin().

◆ S2

const double S2 = 8.33333333332248946124e-03
static

Definition at line 46 of file k_sin.c.

Referenced by __kernel_sin().

◆ S3

const double S3 = -1.98412698298579493134e-04
static

Definition at line 47 of file k_sin.c.

Referenced by __kernel_sin().

◆ S4

const double S4 = 2.75573137070700676789e-06
static

Definition at line 48 of file k_sin.c.

Referenced by __kernel_sin().

◆ S5

const double S5 = -2.50507602534068634195e-08
static

Definition at line 49 of file k_sin.c.

Referenced by __kernel_sin().

◆ S6

const double S6 = 1.58969099521155010221e-10
static

Definition at line 50 of file k_sin.c.

Referenced by __kernel_sin().