34 #ifndef MATHLIB_EXP_SCALAR_H_
35 #define MATHLIB_EXP_SCALAR_H_
43 #include "../common/MATHLIB_scalarTables.h"
44 #include "../common/MATHLIB_types.h"
45 #include "c6x_migration.h"
53 #pragma CODE_SECTION(MATHLIB_exp_scalar_ci, ".text:optci");
58 const float log2_base_x16 = 23.083120654f;
59 const float half = 0.5f;
60 const float LnMin = -87.33654475f;
61 const float LnMax = 88.72283905f;
62 const float Max = 3.402823466E+38f;
63 const double p = 0.0433216987816623;
66 const float c0 = 0.166668549286041f;
67 const float c1 = 0.500016170012920f;
68 const float c2 = 0.999999998618401f;
70 float pol, r, r2, r3, res;
71 unsigned int Ttemp, J, K;
77 Nf = (x * log2_base_x16) + half;
80 if ((x * log2_base_x16) < -half) {
85 r = (float) ((
double) x - (p * (double) N));
89 pol = (r * c2) + ((r3 * c0) + (r2 * c1));
92 K = _extu((
unsigned int) N, 28u, 30u);
93 J = (
unsigned int) N & 0x3u;
97 Ttemp = _hi(dT) + (((
unsigned int) N >> 4) << 20);
98 dT = _itod(Ttemp, _lo(dT));
99 res = (float) dT * (1.0f + pol);
float MATHLIB_exp_scalar_ci(float x)
const double MATHLIB_kTable[4]
const double MATHLIB_jTable[4]