1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- #include "math.h"
- #include "math_private.h"
- static const double
- half = 5.00000000000000000000e-01,
- S1 = -1.66666666666666324348e-01,
- S2 = 8.33333333332248946124e-03,
- S3 = -1.98412698298579493134e-04,
- S4 = 2.75573137070700676789e-06,
- S5 = -2.50507602534068634195e-08,
- S6 = 1.58969099521155010221e-10;
- double attribute_hidden __kernel_sin(double x, double y, int iy)
- {
- double z,r,v;
- int32_t ix;
- GET_HIGH_WORD(ix,x);
- ix &= 0x7fffffff;
- if(ix<0x3e400000)
- {if((int)x==0) return x;}
- 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);
- }
|