Sha256: 4fac0fcd07feb7eef71107f005e4b8530eb4abb7c65e43eef41635ba9621d7f7

Contents?: true

Size: 639 Bytes

Versions: 22

Compression:

Stored size: 639 Bytes

Contents

#!/usr/bin/env ruby
require 'gsl'
include GSL
include Math

f456 = Function.alloc { |x|
  if x.zero?
    val = 0.0
  else
    val = log(x)
  end
  val
}

exp_result = -1.281368483991674190E-01
exp_abserr =  6.875028324415666248E-12

table = [10.0*PI, 1.0, GSL::Integration::SINE, 1000]
result = f456.qawo(0.0, [0.0, 1e-7], table)
p result
puts("exp_result: #{exp_result}")
puts("exp_abserr: #{exp_abserr}")

table = Integration::QAWO_Table.alloc(10.0*PI, 1.0, GSL::Integration::SINE, 1000)
p f456.qawo(0.0, [0.0, 1e-7], table)
p f456.qawo(0.0, table)

p Integration.qawo(f456, 0.0, table)
p Integration.qawo(f456, 0.0, [0.0, 1e-7], table)

Version data entries

22 entries across 22 versions & 4 rubygems

Version Path
gsl-1.14.6 examples/integration/qawo.rb
gsl-1.14.5 examples/integration/qawo.rb