Prev Next

The AD Error Function

Syntax
y = erf(x)

Description
Returns the value of the error function which is defined by  \[
{\rm erf} (x) = \frac{2}{ \sqrt{\pi} } \int_0^x \exp( - t * t ) \; {\bf d} t
\] 


Base
A definition of erf for arguments of type float and double is included in the CppAD namespace (the corresponding results has the same type as the arguments). The type Base can be any type in the AD levels above above float or double.

x
The argument x has prototype
     const AD<
Base>               &x
     const VecAD<
Base>::reference &x

y
The result y has prototype
     AD<
Basey

Operation Sequence
The AD of Base operation sequence used to calculate y is independent of x.

Example
The file Erf.cpp contains an example and test of this function. It returns true if it succeeds and false otherwise.
Input File: cppad/local/erf.hpp