lib/more_math/functions.rb
# Returns an approximate value for the error function's value for +x+.
Returns an approximate value for the error function's value for +x+.
Returns an approximate value for the error function ' s value for + x + .
def erf(x)
        erf_a = MoreMath::Constants::FunctionsConstants::ERF_A
        r = sqrt(1 - exp(-x ** 2 * (4 / Math::PI + erf_a * x ** 2) / (1 + erf_a * x ** 2)))
        x < 0 ? -r : r
      end
def erf ( x ) erf_a = MoreMath :: Constants :: FunctionsConstants :: ERF_A r = sqrt ( 1 - exp ( - x ** 2 * ( 4 / Math :: PI + erf_a * x ** 2 ) / ( 1 + erf_a * x ** 2 ) ) ) x < 0 ? - r : r end
Returns an approximate value for the error function's value for +x+.
Returns an approximate value for the error function ' s value for + x + .
x
<not_specific>