Hi:

Another possibility is to use GSL (Gnu Scientific library). I sometimes use it on R. When you want to use it on J system, Rserve can do that.

load '~system/packages/stats/rdsock.ijs' NB. Before this you must start Rserve program. (R CMD Rserve)
    '' conew 'prdsock'
+-+
|1|
+-+
   Rcmd'library(gsl)' NB. loading gsl library into R system
   Rget'psi(2)'
0.422784
   Rget'psi(1:10)' NB. digamma(1),..,digamma(10)
_0.577216 0.422784 0.922784 1.25612 1.50612 1.70612 1.87278 2.01564 2.14064 2.25175
   Rget'digamma(2)' NB. R Base
0.422784
   Rget'trigamma(2)' NB. R Base
0.644934
Rget'psi_n(0:9,2)' NB. gsl library: 0:9<=>i.10 ; digamma, trigamma, polygamma(2,3,...9) 0.422784 0.644934 _0.404114 0.493939 _0.886266 2.08117 _6.01148 20.5499 _80.9784 360.911

On the R system we can control printing precision like this.

> options(digits = 20)
> pi
[1] 3.141592653589793
> psi(2)
[1] 0.42278433509846702
> psi_n(0:9,2)
[1] 0.42278433509846702 0.64493406684822652 -0.40411380631918858 0.49393940226682931 [5] -0.88626612344087852 2.08116743813389649 -6.01147971498443656 20.54987523763948687
[9] -80.97839874763494095 360.91142238262671071

However Rserve or J connecting program may chop the long digits. I do not know why? Probably the creator rdsock.ijs program knows how to control printing precision.


In the near future I hope that the J system can handle the gsl library.

Best regards.

Toshinari Kamakura


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

Reply via email to