Sha256: 50924b6c700732b98dadbd8e664bafe752d35dadc0e7516ea1d771f9e2adff41

Contents?: true

Size: 622 Bytes

Versions: 16

Compression:

Stored size: 622 Bytes

Contents

#!/usr/bin/env ruby
require("gsl") 

puts("gsl_log1p")
p GSL::log1p(0.1)

a = GSL::Vector.alloc(0.1, 1, 2, 3, 4)
p GSL::log1p(a)

b = GSL::Matrix.alloc([1, 2], [3, 4])
p GSL::log1p(b)
exit

puts("gsl_expm1")
p GSL::expm1(0.1)
p Math::exp(0.1) - 1.0

puts("gsl_hypot")
p GSL::hypot(20000, 30000)
p Math::sqrt(20000*20000 + 30000*30000)

puts("gsl_acosh")
p GSL::acosh(1.5)
p Math::acosh(1.5)

puts("gsl_asinh")
p GSL::asinh(1.5)
p Math::asinh(1.5)

puts("gsl_atanh")
p GSL::atanh(0.5)
p Math::atanh(0.5)

puts("gsl_ldexp")
p GSL::ldexp(1.5, 8)
p Math::ldexp(1.5, 8)

puts("gsl_frexp")
p GSL::frexp(100)
p Math::frexp(100)

Version data entries

16 entries across 16 versions & 4 rubygems

Version Path
rb-gsl-1.16.0.4 examples/math/functions.rb
rb-gsl-1.16.0.3 examples/math/functions.rb
rb-gsl-1.16.0.3.rc1 examples/math/functions.rb
gsl-nmatrix-1.15.3.2 examples/math/functions.rb
gsl-nmatrix-1.15.3.1 examples/math/functions.rb
rb-gsl-1.16.0.2 examples/math/functions.rb
rb-gsl-1.16.0.1 examples/math/functions.rb
rb-gsl-1.16.0 examples/math/functions.rb
rb-gsl-1.15.3.2 examples/math/functions.rb
rb-gsl-1.15.3.1 examples/math/functions.rb
blackwinter-gsl-1.15.3.2 examples/math/functions.rb
gsl-nmatrix-1.15.3.0 examples/math/functions.rb
gsl-1.15.3 examples/math/functions.rb
gsl-1.14.7 examples/math/functions.rb
gsl-1.14.6 examples/math/functions.rb
gsl-1.14.5 examples/math/functions.rb