erf
erf (num [, accuracy ])
The erf function returns the error function of num.
Optionally, accuracy can be used to specify the desired fractional accuracy.
In complex expressions the error function is defined by
where
is the confluent hypergeometric function of the first kind HyperG1F1. In this case the accuracy parameter is ignored.
Details
The accuracy parameter specifies the fractional accuracy that you desire. That is, if you set accuracy to 1e-7, that means that you wish that the absolute value of (factual-freturned)/factual be less than 10-7.
For backwards compatibility, in the absence of accuracy an alternate calculation method is used that achieves fractional accuracy better than about 2x10-7.
If accuracy is present, erf can achieve fractional accuracy better than 8x10-16 for num as small as 10-3. For smaller num fractional accuracy is better than 5x10-15.
Higher accuracy takes somewhat longer to calculate. With accuracy set to 1e-16 erfc takes about 50% more time than with accuracy set to 1e-7.