6#if PROTOCOL_VERSION < 774
9 constexpr float SIN_SCALE = 10430.378f;
10 constexpr float COS_OFFSET = 16384.0f;
11 constexpr long long int SIN_MASK = 65535L;
14 float LUT(
const int index)
16 return static_cast<float>(std::sin(
static_cast<double>(index) * 3.141592653589793 * 2.0 / 65536.0));
20float SinLUT(
const double d)
22 return LUT(
static_cast<int>(
static_cast<float>(d) * SIN_SCALE) & SIN_MASK);
25float CosLUT(
const double d)
27 return LUT(
static_cast<int>(
static_cast<float>(d) * SIN_SCALE + COS_OFFSET) & SIN_MASK);
32 constexpr double SIN_SCALE = 10430.378350470453;
33 constexpr int COS_OFFSET = 16384;
34 constexpr long long int SIN_MASK = 65535L;
37 float LUT(
const int index)
39 return static_cast<float>(std::sin(
static_cast<double>(index) / SIN_SCALE));
45 return LUT(
static_cast<int>(
static_cast<long long>(d * SIN_SCALE) & SIN_MASK));
50 return LUT(
static_cast<int>(
static_cast<long long>(d * SIN_SCALE + COS_OFFSET) & SIN_MASK));
float SinLUT(const double d)
float CosLUT(const double d)