Sha256: 83b829a20695c5851c92164242ff342cd61cd7b9d3a39241850acb83f7107ad6

Contents?: true

Size: 358 Bytes

Versions: 5

Compression:

Stored size: 358 Bytes

Contents

module Math
  def self.inverf(x)
    sign = x < 0 ? -1 : 1
    x = x.abs
    a = 8 / (3*Math::PI) * (Math::PI-3) / (4-Math::PI)
    part0 = ( 2/(Math::PI*a) + (Math.log(1-x*x)) / 2 )**2
    part = -2 / (Math::PI * a) - Math.log(1-x*x)/2 + Math.sqrt(-1/a * Math.log(1-x*x) + part0)
    sign * Math.sqrt(part)
  end
  def inverf(x)
    Math.inverf(x)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bioinform-0.1.17 lib/bioinform/support/inverf.rb
bioinform-0.1.16 lib/bioinform/support/inverf.rb
bioinform-0.1.15 lib/bioinform/support/inverf.rb
bioinform-0.1.14 lib/bioinform/support/inverf.rb
bioinform-0.1.13 lib/bioinform/support/inverf.rb