1 // 2 // This is an automatically generated file. 3 // Do not edit. 4 // 5 6 7 extern const unsigned int log10Table[]; 8 extern const unsigned int logTable[]; 9 extern const unsigned short expTable[]; 10 11 12 inline float log10_h(half x)13log10_h (half x) 14 { 15 return *(float *)(&log10Table[x.bits()]); 16 } 17 18 19 inline float log_h(half x)20log_h (half x) 21 { 22 return *(float *)(&logTable[x.bits()]); 23 } 24 25 26 inline half exp_h(float x)27exp_h (float x) 28 { 29 if (x >= -16.6355323f) 30 { 31 if (x <= 11.0898665f) 32 { 33 // 34 // If we arrive here, then x is finite and between 35 // log(HALF_MIN) and log(HALF_MAX); indexing into 36 // expTable will not fail. 37 // 38 39 return *(half *)(&expTable[int (x * 4094.98169f + 68122.7031f)]); 40 } 41 else 42 { 43 return half::posInf(); 44 } 45 } 46 else if (x < -16.6355323f) 47 { 48 return 0; 49 } 50 else 51 { 52 // 53 // If we arrive here, then x is a NaN. 54 // 55 56 return half::qNan(); 57 } 58 } 59 60 61 inline half pow10_h(float x)62pow10_h (float x) 63 { 64 return exp_h (x * 2.30258509f); 65 } 66 67 68 inline half pow_h(half x,float y)69pow_h (half x, float y) 70 { 71 return exp_h (y * log_h (x)); 72 } 73 74