Mark D. Niemiec wrote:
>
> It is possible that a library tanh function might attempt higher
> accuracy by using extended precision internally, so smaller
> values of T might be necessary for them.

The tanh function in fdlibm at

<http://www.netlib.org/fdlibm/s_tanh.c>

calculates tanh for large arguments as

tanh=:1 - 2% expm1 @: +:

where expm1 is another library function calculating

expm1=:_1 + ^

For arguments greater than 22, tanh is 1.  I have not checked how much
lower this goes.

Best wishes,

John


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to