You've already forked torvalds-GuitarPedal
mirror of
https://github.com/torvalds/GuitarPedal.git
synced 2026-06-08 04:55:36 +00:00
This is a [5/4]-Padé approximant, tweaked to also always limit the
result to the ±1.0 range.
It's basically accurate to within the float representation(*) in the
reasonable [-1,1] range, with the max error at ±3.647, where the
accuracy has fallen to "only" 9.5 bits (2.87 decimal digits).
This was triggered by discussion with Ricky Sheaves, who is tuning the
Echo King effect and the simplistic tanh() approximation using the
'limit_value()' code was audibly not good enough.
I didn't actually make the Echo King code use this new tanhf(), because
Ricky is doing other changes to it too, but I wanted to at least add the
improved infrastructure.
(*) Ok, really only 22 bits - we're not talking "0.5 ULP" kind of
precision here. It's still an approximation, just a very good one.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>