zcffs
Ruby
code posted
by
asdfds
created at 13 Oct 07:59
Edit
|
Back
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
E=Math.exp(1) s=[10,100,1000] puts "ex-e-x/ex+e-x:" s.sort.each{ |x| puts (E**(x)-E**(-x))/(E**(x)+E**(-x)) } puts "\ne2x-1/e2x+1:" s.sort.each{ |x| puts (E**(2*x)-1)/(E**(2*x)+1) } puts "\n1-e-2x/1+e-2x:" s.sort.each{ |x| puts (1-E**(-2*x))/(1+E**(-2*x)) } puts "\n1-e-2x/1+e-2x:" s.sort.each{ |x| puts (1-E**(-2*x))/(1+E**(-2*x)) } puts "\n1-2/1+e2x:" s.sort.each{ |x| puts (1-2/(1+E**(2*x))) } puts "\n(0.5-1/1+e2x)+(0.5-1/1+e2x):" s.sort.each{ |x| puts (0.5-1/(1+E**(2*x)))+0.5-1/(1+E**(2*x)) } |
511 Bytes in 3 ms with coderay