yes, you need to use a [clip~ -3 3] to restrict the input. But the function converges to +0.999999 and -0.999999 or whatever by then anyway, so for all practical purposes it is fine.
On Fri, Jul 3, 2015 at 2:26 PM, Miller Puckette msp@ucsd.edu wrote:
I've never seen that approximation before but there must be some restriction on the allowable values of X since the expression diverges for large positive or negative values of x, while tanh(x) converges to +1 nad -1, respectively.
cheers Miller On Fri, Jul 03, 2015 at 01:23:29PM +0900, i go bananas wrote:
there's a good approximation for tanh that can be made using just a
couple
of simple arithmetic objects:
formula is: tanh(x) ~= x*(27+x*x) / (27+9*x*x)
it's close enough for every application i've ever come across, it's cheap cos it only uses simple arithmetic, and it doesn't degrade the resolution of your signal like a table lookup does.
On Fri, Jul 3, 2015 at 12:56 PM, Chris McCormick chris@mccormick.cx
wrote:
On 03/07/15 03:06, Pagano, Patrick wrote:
Is there a way i can replace something for tanh~ and inits in Vanilla 46?
Using a pre-computed table for speed:
https://github.com/chr15m/blockhead/blob/master/e_tanh.pd https://github.com/chr15m/blockhead/blob/master/e_tanh-help.pd
Or install "blockhead" using deken. :)
Cheers,
Chris.
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management ->