UNPKG

993 BMarkdownView Raw
1<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
2
3# Function erf
4
5Compute the erf function of a value using a rational Chebyshev
6approximations for different intervals of x.
7
8This is a translation of W. J. Cody's Fortran implementation from 1987
9( https://www.netlib.org/specfun/erf ). See the AMS publication
10"Rational Chebyshev Approximations for the Error Function" by W. J. Cody
11for an explanation of this process.
12
13For matrices, the function is evaluated element wise.
14
15
16## Syntax
17
18```js
19math.erf(x)
20```
21
22### Parameters
23
24Parameter | Type | Description
25--------- | ---- | -----------
26`x` | number &#124; Array &#124; Matrix | A real number
27
28### Returns
29
30Type | Description
31---- | -----------
32number &#124; Array &#124; Matrix | The erf of `x`
33
34
35## Examples
36
37```js
38math.erf(0.2) // returns 0.22270258921047847
39math.erf(-0.5) // returns -0.5204998778130465
40math.erf(4) // returns 0.9999999845827421
41```
42
43