Module: Math

Defined in:
lib/macroape/support/inverf.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.inverf(x) ⇒ Object



2
3
4
5
6
7
8
9
# File 'lib/macroape/support/inverf.rb', line 2

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

Instance Method Details

#inverf(x) ⇒ Object



10
11
12
# File 'lib/macroape/support/inverf.rb', line 10

def inverf(x)
  Math.inverf(x)
end