mmc_fastmath.h
1 /***************************************************************************/
32 /***************************************************************************/
38 #ifndef _MMC_FAST_MATH_FUNCTIONS_H
39 #define _MMC_FAST_MATH_FUNCTIONS_H
40 
50 static inline float fast_expf9(float x) {
51  return (362880.f + x * (362880.f + x * (181440.f + x * (60480.f + x * (15120.f + x * (3024.f + x * (504.f + x * (72.f + x * (9.f + x))))))))) * 2.75573192e-6f;
52 }
53 
54 /*
55 static inline float fast_log2(float x) {
56  int i = (*(int *)&x);
57  return (((i&0x7f800000)>>23)-0x7f)+(i&0x007fffff)/(float)0x800000;
58 }
59 
60 static inline float fast_logf(float x) {
61  return 0.693147180559945f*fast_log2(x);
62 }
63 */
64 
65 #endif