1 # The Computer Language Shootout
2 # http://shootout.alioth.debian.org/
3 # Contributed by Sokolov Yura
6 return 1.0/((i+j)*(i+j+1)/2+i+1)
11 (0..u.length-1).collect { |i|
13 for j in 0..u.length-1
20 def eval_At_times_u(u)
22 (0..u.length-1).collect{|i|
24 for j in 0..u.length-1
31 def eval_AtA_times_u(u)
32 return eval_At_times_u(eval_A_times_u(u))
35 n = 500 # ARGV[0].to_i
49 str = "%0.9f" % (Math.sqrt(vBv/vv)), "\n"