1 #ifndef DataFormatsMathAPPROX_LOG_H 2 #define DataFormatsMathAPPROX_LOG_H 58 return y * (
float(0xf.ff652p-4) +
59 y * (-
float(0x8.0048ap-4) +
66 return y * (
float(0xf.fff14p-4) +
67 y * (-
float(0x7.ff4bfp-4) +
76 y * (-
float(0x7.ffe57p-4) +
78 y * (-
float(0x4.037a6p-4) +
89 y * (
float(-0x3.fedcep-4) +
102 int e = (((
xx.i32) >> 23) & 0xFF) - 127;
103 m.i32 = (
xx.i32 & 0x007FFFFF) | 0x3F800000;
105 int adjust = (
xx.i32 >> 22) & 1;
106 m.i32 -= adjust << 23;
110 float y =
m.f - 1.0f;
114 float p = approx_logf_P<DEGREE>(y);
116 constexpr
float Log2 = 0xb.17218p-4;
120 #ifndef NO_APPROX_MATH 121 template <
int DEGREE>
123 return unsafe_logf_impl<DEGREE>(
x);
126 template <
int DEGREE>
130 constexpr
float MAXNUMF = 3.4028234663852885981170418348451692544e38f;
133 float res = unsafe_logf<DEGREE>(
x);
135 return (
x > 0) ?
res : std::numeric_limits<float>::quiet_NaN();
139 template <
int DEGREE>
144 template <
int DEGREE>
149 #endif // NO_APPROX_MATH constexpr float approx_logf_P< 2 >(float y)
constexpr float approx_logf_P< 7 >(float y)
constexpr float unsafe_logf(float x)
constexpr float approx_logf_P< 4 >(float y)
constexpr float approx_logf_P< 5 >(float y)
constexpr float approx_logf_P(float p)
constexpr float unsafe_logf_impl(float x)
constexpr float approx_logf_P< 8 >(float y)
constexpr float approx_logf_P< 6 >(float y)
constexpr float approx_logf_P< 3 >(float y)
constexpr float approx_logf(float x)