Hi all,
An approximation to tanh(x) is a continued fraction
x/1+ (x^2)/3+ (4x^2)/5+ (16x^2)/9+ ...
See attached.
I got it working, but by trial and error needed to scale the domain by 1/pi and add some weird scale to the range. I'm confused about where these numbers come from. Can anyone explain this please?
cheers,
Andy
Hi,
An approximation to tanh(x) is a continued fraction x/1+ (x^2)/3+ (4x^2)/5+ (16x^2)/9+ ...
are you sure this is correct? Another well-known formulation is x/(1+x^2/(3+x^2/(5+x^2/(7+..... which works for me and converges quickly. see http://nrich.maths.org/public/viewer.php?obj_id=1451
gr~~~
oops, forgot the attachment....
Am 07.10.2008 um 14:46 schrieb Thomas Grill:
Hi,
An approximation to tanh(x) is a continued fraction x/1+ (x^2)/3+ (4x^2)/5+ (16x^2)/9+ ...
are you sure this is correct? Another well-known formulation is x/(1+x^2/(3+x^2/(5+x^2/(7+..... which works for me and converges quickly. see http://nrich.maths.org/public/viewer.php?obj_id=1451
gr~~~
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
Yep, they both converge on tanh afaics. Your one is more efficient though, I'll use that. (attached)
But what I don't understand is why it needs scaling and doesn't naturally work over -1 to +1
cheers,
Andy
On Tue, 7 Oct 2008 14:46:56 +0200 Thomas Grill gr@grrrr.org wrote:
Hi,
An approximation to tanh(x) is a continued fraction x/1+ (x^2)/3+ (4x^2)/5+ (16x^2)/9+ ...
are you sure this is correct? Another well-known formulation is x/(1+x^2/(3+x^2/(5+x^2/(7+..... which works for me and converges quickly. see http://nrich.maths.org/public/viewer.php?obj_id=1451
gr~~~