34 #ifndef MATHLIB_LOG_SCALAR_H_
35 #define MATHLIB_LOG_SCALAR_H_
43 #include "../common/MATHLIB_scalarTables.h"
44 #include "../common/MATHLIB_types.h"
45 #include "c6x_migration.h"
55 double ln2 = 0.693147180559945f;
56 float c1 = -0.2302894f;
57 float c2 = 0.1908169f;
58 float c3 = -0.2505905f;
59 float c4 = 0.3333164f;
60 float c5 = -0.5000002f;
61 float MAXe = 3.402823466E+38f;
62 float pol, r1, r2, r3, r4, res;
63 double dr, frcpax, rcp, T;
68 rcp = _rcpdp((
double) a);
69 frcpax = _itod(_clr(_hi(rcp), 0u, 16u), 0u);
70 dr = (frcpax * (double) a) - 1.0;
78 pol = (c5 * r2) + ((c4 * r3) + ((((c2 * r1) + c3) + (c1 * r2)) * r4));
81 N = (int) _extu(_hi(frcpax), 1u, 21u) - 1023;
82 T_index = _extu(_hi(frcpax), 12u, 29u);
84 res = (float) (dr + T) + pol;
87 res = _itof(0xFF800000u);
static float MATHLIB_log_scalar_ci(float a)
const double MATHLIB_logTable[8]