43 #define ATAN2SP_I_H_ 1
45 #include "../common/MATHLIB_utility.h"
46 #include <c6x_migration.h>
50 #define TRUE ((t_bool) true)
51 #define FALSE ((t_bool) false)
53 static double ti_math_vTable[4] = {0.00000000000000000000, 0.52359877559829887308, 1.57079632679489661923,
54 1.04719755119659774615};
60 #pragma CODE_SECTION(divspMod_atan2spi, ".text:optci");
67 #pragma CODE_SECTION(atan2f_sr1i_atan2spi, ".text:optci");
82 float c1 = 0.00230158202f;
83 float c2 = -0.01394551000f;
84 float c3 = 0.03937087815f;
85 float c4 = -0.07235669163f;
86 float c5 = 0.10521499322f;
87 float c6 = -0.14175076797f;
88 float c7 = 0.19989300877f;
89 float c8 = -0.33332930041f;
115 tmp1 = (c5 * g8) + (c6 * g6) + (c7 * g4) + (c8 * g2);
116 tmp2 = (((c1 * g4) + (c2 * g2) + c3) * g12) + (c4 * g10);
119 pol = (pol * g1) + g1;
122 return ((s !=
FALSE) ? (coef - pol) : (coef + pol));
130 double p0 = -1.3688768894191926929e+1;
131 double p1 = -2.0505855195861651981e+1;
132 double p2 = -8.4946240351320683534e+0;
133 double p3 = -8.3758299368150059274e-1;
134 double q0 = 4.1066306682575781263e+1;
135 double q1 = 8.6157349597130242515e+1;
136 double q2 = 5.9578436142597344465e+1;
137 double q3 = 1.5024001160028576121e+1;
138 double sqrt3 = 1.7320508075688772935e+0;
139 double iims3 = 2.6794919243112270647e-1;
140 double F, G, H, R, RN, RD;
166 RN = ((((((p3 * G) + p2) * G) + p1) * G) + p0) * G;
167 RD = ((((((G + q3) * G) + q2) * G) + q1) * G) + q0;
186 #pragma CODE_SECTION(atan2sp_i, ".text:optci");
196 float pih = 1.570796327f;
197 float pi = 3.141592741f;
198 float Max = 3.402823466E+38f;
209 if (_fabsf(a) > _fabsf(b)) {
223 res = y >= 0.0f ? 0.0f : pi;
238 if (y == 0.0f && x > 0) {
241 if (y == 0.0f && x < 0) {
251 double HalfPI = 1.57079632679489661923;
252 double MATHLIB_PI = 3.14159265358979323846;
253 double Maxv = 1.7976931348623157e+308;
254 double X, Y, Z, W, res;
266 res = MATHLIB_PI + W;
268 res = W - MATHLIB_PI;
273 res = Y > 0.0f ? HalfPI : -HalfPI;
277 res = X >= 0.0f ? 0.0 : MATHLIB_PI;
double MATHLIB_atan2_scalar_ci< double >(double a, double b)
static float atan2f_sr1i_atan2spi(float g1, float pih, t_bool s, t_bool bn, t_bool an)
float MATHLIB_atan2_scalar_ci< float >(float a, float b)
static double ti_math_vTable[4]
static float MATHLIB_atan2_scalar_sp(float a, float b)
static double atandpMod_atan2dpi(double a)
static double MATHLIB_atan2_scalar_dp(double a, double b)
static float divspMod_atan2spi(float a, float b)
static double divdpMod_atan2dpi(double a, double b)
static T MATHLIB_atan2_scalar_ci(T a, T b)
static float cmn_DIVSP(float a, float b)
static double cmn_DIVDP(double a, double b)