34 static_assert(
sizeof(float) ==
sizeof(int32_t));
40 auto log_2 = (float)(((u.x >> 23) & 255) - 128);
43 log_2 += ((-0.3358287811f) * u.val + 2.0f) * u.val - 0.65871759316667f;
46static constexpr float log2ToDb = 20 / 3.321928094887362f;
constexpr float FastLog2(float x)
Approximates the base-2 logarithm of a float to two decimal places, adapted from https://stackoverflo...
static constexpr float log2ToDb