Module: BigMathR::Erf

Defined in:
ext/bigdecimal/math_r/erf.c,
ext/bigdecimal/math_r/math_r.c

Overview

A module that provides an eror functions. It is used internally.

Synopsis

Some functions are common in the C/C++ standard. However, it is not actually defined in C/C++, and is specified in POSIX.

  • Error function: :erf

  • Complementary Error function: :erfc

The following are complex functions that are reserved words mainly for Linux OS.

  • Error function: :cerf

  • Complementary Error function: :cerfc

Reference

Multiple-Precision Exponential Integral and Related Functions - David M. Smith

Class Method Summary collapse

Class Method Details

.erfc_algo911(x, prec) ⇒ BigDecimal

Calculate the complementary error function of x.

Examples:

BigMathR::Erf.erfc_algo911(-7, 20)
#=> 0.2e1
BigMathR::Erf.erfc_algo911(-7, 40)
#=> 0.1999999999999999999999958161743922205856e1
BigMathR::Erf.erfc_algo911(7, 20)
#=> 0.0
BigMathR::Erf.erfc_algo911(7, 40)
#=> 0.41838256077794144e-22

Parameters:

  • x (Numeric)

    Numerical Argument.

  • prec (Integer)

    Arbitrary precision

Returns:

  • (BigDecimal)

    Real solution

Raises:

  • (FloatDomainError)

    Numerical arguments are out of range

Since:

  • 0.2.0



50
51
52
53
54
# File 'ext/bigdecimal/math_r/erf.c', line 50

static VALUE
__impl_erf_erfc_algo911(VALUE unused_obj, VALUE x, VALUE prec)
{
	return erfc_branch(x, prec, erfc_algo911);
}