JUCE's Fast Math Approximations Needed
-
Even we only use a basic TanH function for the Waveshaping (generally lots of functions are used simultaneously), it is very cpu hungry since the cpu need to check and calculate for the each sample.
Because of that JUCE has
dsp::FastMathApproximations
for much more faster calculations than the standart math functions.@Christoph-Hart Can you please enable them in the API, so we can use them in SNEX with cpu efficiency?
https://docs.juce.com/master/structdsp_1_1FastMathApproximations.html
-
Sure why not? You can use them now with
Math.fasttanh(input)
et al (the autocomplete also provides you the valid input range).Not sure if they are super useful though, the tanh range is rather limited so for distortion effects you will need to use the proper function.
-
@Christoph-Hart Thank you so much man, I'll try and use them ASAP.
I have really complex equations that use the trigonometric math functions like tanh, cosh, cos, atan... several times as a combination on each equation. So I think the total performance should be improved now. Thank you!