diff --git a/dsp/levelpath.cpp b/dsp/levelpath.cpp index 95d9fac..bca6187 100644 --- a/dsp/levelpath.cpp +++ b/dsp/levelpath.cpp @@ -61,22 +61,19 @@ static float eval_lut_bin(float x, const BandConfig* band) { float result; if (band->flag == 0) { // Linear path (0x563595): t = x^(1/γ) if γ!=1 && x>0; val = A + (B-A)*t + // decomp: fVar16 = expf(logf(x)/gamma) (FLOAT log/exp) float t = x; if (gamma != ONE && x > ZERO) { - double d = static_cast(fabsf(x)); - d = std::log(d) / static_cast(gamma); - t = static_cast(std::exp(d)); + t = expf(logf(x) / gamma); } result = band->A + (band->B - band->A) * t; } else { // Power-law path (0x5635cd): t = 2x-1; if γ!=1 && t!=0: t = sign(t)·|t|^(1/γ) - // val = A + (B-A)·0.5·(1+t) + // val = A + (B-A)·0.5·(1+t); decomp: sign·expf(logf(|t|)/gamma) float t = TWO * x - ONE; if (gamma != ONE && t != ZERO) { float sign = (t < ZERO) ? NEG1 : ONE; - double d = static_cast(fabsf(t)); - d = std::log(d) / static_cast(gamma); - t = static_cast(std::exp(d)) * sign; + t = expf(logf(fabsf(t)) / gamma) * sign; } result = band->A + (band->B - band->A) * HALF * (ONE + t); }