34 #ifndef MATHLIB_COSH_SCALAR_H_
35 #define MATHLIB_COSH_SCALAR_H_
43 #include "../common/MATHLIB_scalarTables.h"
44 #include "../common/MATHLIB_types.h"
45 #include "c6x_migration.h"
60 #pragma CODE_SECTION(expsp_coshsp_i, ".text:optci");
70 const float log2_base_x16 = 23.0831206542234f;
71 const float Half = 0.5f;
72 const float LnMax = 88.72283905f;
73 const float Ln2 = 0.693147180559945f;
74 const double p = 0.0433216987816623;
77 const float c0 = 0.166668549286041f;
78 const float c1 = 0.500016170012920f;
79 const float c2 = 0.999999998618401f;
81 float pol, r, r2, r3, res;
82 unsigned int Ttemp, J, K;
88 Nf = (x * log2_base_x16) + Half;
91 if ((x * log2_base_x16) < -Half) {
96 r = (float) ((
double) x - (p * (double) N));
100 pol = (r * c2) + ((r3 * c0) + (r2 * c1));
105 K = _extu((
unsigned int) N, 28u, 30u);
106 J = (
unsigned int) N & 0x3u;
110 Ttemp = _hi(dT) + (((
unsigned int) N >> 4) << 20);
111 dT = _itod(Ttemp, _lo(dT));
113 res = (float) (dT * (1.0 + (
double) pol));
117 if ((x - Ln2) > LnMax) {
118 res = _itof(0x7F800000u);
125 #pragma CODE_SECTION(recipsp_coshsp_i, ".text:optci");
135 const float two = 2.0f;
139 y = y * (two - (a * y));
140 y = y * (two - (a * y));
155 #pragma CODE_SECTION(pol_est_coshsp_i, ".text:optci");
170 const float c1 = 2.48015873015873e-5f;
171 const float c2 = 0.00138888888888889f;
172 const float c3 = 0.0416666666666667f;
173 const float c4 = 0.5000000f;
175 float x2, x4, x6, x8, pol;
183 pol = ((c4 * x2) + (c3 * x4)) + ((c1 * x8) + (c2 * x6));
190 #pragma CODE_SECTION(MATHLIB_cosh_scalar_ci, ".text:optci");
208 const float half = 0.5f;
209 const float bound = 16.0f;
210 const float Max = 89.41598629f;
211 const float pol_bound = 1.0f;
212 float res, x_abs, temp, exp_;
220 else if (x_abs <= pol_bound) {
226 res = (exp_ + temp) * half;
230 res = _itof(0x7F800000u);
static float recipsp_coshsp_i(float a)
static float pol_est_coshsp_i(float x)
static float MATHLIB_cosh_scalar_ci(float x)
static float expsp_coshsp_i(float x)
const double MATHLIB_kTable[4]
const double MATHLIB_jTable[4]