42 #include "c7x_scalable.h"
46 #include "../common/MATHLIB_scalarTables.h"
47 #include "../common/MATHLIB_types.h"
48 #include <c6x_migration.h>
56 #pragma CODE_SECTION(logsp_asinhsp_i, ".text:optci");
67 const float c1 = -0.2302894f;
68 const float c2 = 0.1908169f;
69 const float c3 = -0.2505905f;
70 const float c4 = 0.3333164f;
71 const float c5 = -0.5000002f;
73 const double ln2 = 0.693147180559945;
74 const float max = 88.7228390519551f;
75 float pol, r1, r2, r3, r4, res;
76 double dr, frcpax, rcp, T;
83 c7x::double_vec x_vec = (c7x::double_vec) x;
84 c7x::double_vec rcp_vec = __recip(x_vec);
88 frcpax = _itod(_clr(_hi(rcp), 0u, 16u), 0u);
89 dr = (frcpax * (double) x) - 1.0;
98 pol = (c5 * r2) + (c4 * r3) + ((((c2 * r1) + c3) + (c1 * r2)) * r4);
101 N = (int) _extu(_hi(frcpax), 1u, 21u) - 1023;
102 T_index = _extu(_hi(frcpax), 12u, 29u);
104 res = (float) (dr + T) + pol;
114 #pragma CODE_SECTION(sqrtsp_asinhsp_i, ".text:optci");
126 const float half = 0.5f;
127 const float OneP5 = 1.5f;
128 float x0, x1, x2, res, a_half;
133 c7x::float_vec a_vec = (c7x::float_vec) a;
134 c7x::float_vec x0_vec = __recip_sqrt(a_vec);
139 x1 = OneP5 - (a_half * x0 * x0);
141 x2 = x1 * (OneP5 - (x1 * x1 * a_half));
152 #pragma CODE_SECTION(asinhsp_i, ".text:optci");
173 const float ln2 = 0.69314718056f;
174 const float pol_bound = 0.5f;
175 const float half = 0.5f;
179 const float c2 = -0.166605362341955f;
180 const float c4 = 0.0734464812833510f;
181 const float c6 = -0.0330279320352987f;
183 float res, sqrt_, pol;
184 float x2, x4, x6, x_abs;
190 c7x::float_vec x_vec = (c7x::float_vec) x;
191 c7x::float_vec x_abs_vec = __abs(x_vec);
192 x_abs = x_abs_vec.s[0];
206 pol = (x2 * c2) + (x4 * c4) + (x6 * c6);
213 temp = (sqrt_ * half) + (x_abs * half);
218 if (x_abs <= pol_bound) {
static float asinhsp_i(float x)
static float sqrtsp_asinhsp_i(float a, float x)
static float logsp_asinhsp_i(float x)
const double MATHLIB_logTable[8]