On Sun, Mar 2, 2008 at 7:45 AM, Roger Hui <[EMAIL PROTECTED]> wrote:
>    T=: 27*^.2
>
>  (spoiler alert.)
>
>
>  What is interesting about T=:27*^.2 ?  In IEEE 64-bit
>  floating point calculation, for all y>:T, 1=tanh y
>  (and _1=tanh -y) and T is the smallest number with
>  this property.
>
>    tanh=: (^ - [EMAIL PROTECTED]) % (^ + [EMAIL PROTECTED])

I would rather defined tanh as

 tanh1 =: 7&o.

If you use this definition, then the above statement is not true.  In
fact, (tanh1 0.2 + T) is still not exactly one.  This is similary to
what I get if I use the tanh function in the GNU libc, which is
supposed to be very precise, so I assume that for such large values,
tanh1 gives a more precise result than your tanh function (the
difference is minute of course).

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

Reply via email to