Functions
vnl_erf.h File Reference

Error Function (erf) approximations. More...

#include <vnl/vnl_gamma.h>
#include <vnl/vnl_math.h>
#include "vnl/vnl_export.h"

Go to the source code of this file.

Functions

double vnl_erf (double x)
 The Error function. More...
 
VNL_EXPORT double vnl_erfc (double x)
 The Complementary Error function. More...
 
double vnl_scaled_erfc (double x)
 The Scaled Complementary Error function. More...
 

Detailed Description

Error Function (erf) approximations.

Author
Tim Cootes, Ian Scott

Definition in file vnl_erf.h.

Function Documentation

◆ vnl_erf()

double vnl_erf ( double  x)
inline

The Error function.

erf(x) = (2/sqrt(pi)) Integral from 0 to x (exp(-t^2) dt)

Note
the output ranges from -1 to 1, and vnl_erf(0) = 0.

Definition at line 16 of file vnl_erf.h.

◆ vnl_erfc()

VNL_EXPORT double vnl_erfc ( double  x)

The Complementary Error function.

erfc(x) = 1 - erf(x) = 1 - (2/sqrt(pi)) Integral from 0 to x (exp(-t^2) dt) This value is useful for large x, when erf(x) ~= 1 and erfc(x) < eps.

Note
the output ranges from 0 to 2, and vnl_erfc(0) = 1.

Definition at line 13 of file vnl_erf.cxx.

◆ vnl_scaled_erfc()

double vnl_scaled_erfc ( double  x)
inline

The Scaled Complementary Error function.

erfc_scaled(x) = exp(x^2) * erfc(x) This value is useful for very large x, where erf and erfc returns respectively ~1 and ~0. It can be approximated by (1/sqrt(pi)) * (1/x)

Definition at line 30 of file vnl_erf.h.