Created
October 31, 2018 16:07
-
-
Save mtytel/e7e90604fa38bad60a512aac55c9e261 to your computer and use it in GitHub Desktop.
clipped exponential power scale
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float powerScale(mono_float value, mono_float power) { | |
static constexpr float kMinPower = 0.01f; | |
if (fabsf(power) < kMinPower) | |
return value; | |
float numerator = mopo::futils::exp(power * value) - 1.0f; | |
float denominator = mopo::futils::exp(power) - 1.0f; | |
return numerator / denominator; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment