Optimise usage of pow using fast equivalent and exp2 (#7548)
* replace std::pow with better performing equivalents * revert one instance where I swapped to fastPow10f * Negative slope instead of multiplying -1 Co-authored-by: saker <sakertooth@gmail.com> --------- Co-authored-by: saker <sakertooth@gmail.com>
This commit is contained in:
@@ -237,7 +237,7 @@ public:
|
||||
|
||||
static inline float freqFromWaveTableBand(int band)
|
||||
{
|
||||
return 440.0f * std::pow(2.0f, (band * OscillatorConstants::SEMITONES_PER_TABLE - 69.0f) / 12.0f);
|
||||
return 440.0f * std::exp2((band * OscillatorConstants::SEMITONES_PER_TABLE - 69.0f) / 12.0f);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user