erf

From DavinciWiki
Jump to: navigation, search

Description

Error function

Arguments and Return Values

Arguments: One numeric array

Return Value: An array with the same organization as the input containing the value of the error function evaluated at the each element of the input. The output format is double if the input is double, float otherwise.

The error function is defined as erf(x) = integral from 0 to x of exp(-t^2)*2/√π with respect to t

This function uses a numerical approximation from W. J. Cody and Peter J. Acklam, which is accurate within the precision of the input.

If no arguments are input, erf() prints its description, as shown below.

Usage

Syntax: erf(x)

'x' - A numeric array of any format

Examples

dv> erf()

Error function
erf(x) = integral from 0 to x of exp(-t^2)*2/sqrt(pi)
Works for arrays
Accurate within precision of input
Uses algorithm from W. J. Cody and Peter J. Acklam
See http://www.jstor.org/view/00255718/di970531/97p03754/0,
 http://search.cpan.org/src/REID/Games-Go-GoPair-1.001/Erf.pm,
 and http://www.netlib.org/specfun/erf
S.Marshall 02-17-2008

0
dv> erf(-1//0//1)
3x1x1 array of float, bsq format [12 bytes]
-0.842701       0.00000 0.842701

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Major Sub-Functions

Related Functions

Recent Library Changes

Created On: 02-21-2008
Modified On: 02-22-2008

Personal tools