To be competitive you'll have to use something like this in J:

fib4=: (($:_1&+)+($:_2&+))[EMAIL PROTECTED](2>])]

   ts 'fib4 35'
53.3597 9664

And this is comparable with the timing of Haskell interpreted (GHCi) on
my computer. But, I don't know how comparable naive this is. :-)


Some other results:

Ruby 1.8.2:

...
n=33 => 3524578
n=34 => 5702887
n=35 => 9227465

real    1m7.355s
user    1m7.292s
sys     0m0.004s


Python 2.4:

...
n=33 => 3524578
n=34 => 5702887
n=35 => 9227465

real    0m45.739s
user    0m45.591s
sys     0m0.012s



BTW: Haskell version GHC 6.8.1


=@@i


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

Reply via email to