35 float oneToTwo = 1.0f + (1.0f / (float)( 1 <<(precision + 1) ));
37 for(i = 0; i < (1 << precision); ++i){
39 lookup_table[i] = logf(oneToTwo) / 0.69314718055995f;
40 oneToTwo += 1.0f / (float)( 1 << precision );
44 float icsi_log(
float arg,
const float* lookup_table,
const uint32_t precision){
46 register const int32_t*
const pVal = (
const int32_t*)(&arg);
48 register const int32_t exp = ((*pVal >> 23) & 255) - 127;
49 register const int32_t man = (*pVal & 0x7FFFFF) >> (23 - precision);
51 return ((
float)(exp) + lookup_table[man]) * 0.69314718055995f;
float icsi_log(float arg, const float *lookup_table, const uint32_t precision)
void fill_icsi_log_table(float *lookup_table, const uint32_t precision)