Roger Hui <[EMAIL PROTECTED]> works: > What is interesting about 27*^.2 ? > > T=: 27*^.2
> 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]) This seems quit reasonable, since (tanh y) -: (p - %p) % (p + %p) NB. p=.^y (^T) -: 2^27 p differs from %p by 2^54 (which is 2 * the double-precision accuracy). 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. In my own experiments (using J6.01 on XP), I found 27*^.2 to produce inequality, while values around 27.5*^.2 and above produce equality. -- Mark D. Niemiec <[EMAIL PROTECTED]> ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
