module Mathpack::Functions
Public Class Methods
beta(a, b)
click to toggle source
# File lib/mathpack/functions.rb, line 11 def self.beta(a, b) gamma(a) * gamma(b) / gamma(a + b) end
dawson_minus(x)
click to toggle source
# File lib/mathpack/functions.rb, line 19 def self.dawson_minus(x) Math.exp(x**2) * Mathpack::Integration.integrate(from: 0.0, to: x) { |x| Math.exp(-x**2) } end
dawson_plus(x)
click to toggle source
# File lib/mathpack/functions.rb, line 15 def self.dawson_plus(x) Math.exp(-x**2) * Mathpack::Integration.integrate(from: 0.0, to: x) { |x| Math.exp(x**2) } end
erf(x)
click to toggle source
# File lib/mathpack/functions.rb, line 7 def self.erf(x) 1.0 / (2.0 * Math::PI)**0.5 * Mathpack::Integration.integrate(from: -Float::INFINITY, to: x) { |u| Math.exp(-u**2 / 2.0) } end
gamma(t)
click to toggle source
# File lib/mathpack/functions.rb, line 3 def self.gamma(t) Mathpack::Integration.integrate(from: 0.0, to: Float::INFINITY) { |x| x**(t-1) * Math.exp(-x) } end
heaviside(x)
click to toggle source
# File lib/mathpack/functions.rb, line 23 def self.heaviside(x) x <= 0.0 ? 0 : 1 end