Skip to content

Commit

Permalink
Merge pull request #2295 from idlike2dream/erf_doc
Browse files Browse the repository at this point in the history
Fix documentation of error functions
  • Loading branch information
jrioux committed Aug 3, 2013
2 parents ccdcb3c + 0d2a510 commit e5dbc80
Showing 1 changed file with 122 additions and 133 deletions.
255 changes: 122 additions & 133 deletions sympy/functions/special/error_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,10 @@

class erf(Function):
r"""
The Gauss error function.
This function is defined as:
The Gauss error function. This function is defined as:
.. math ::
\operatorname{erf}(x)=\frac{2}{\sqrt{\pi}} \int_0^x e^{-t^2} \, \mathrm{d}x.
Or, in ASCII::
x
/
|
| 2
| -t
2* | e dt
|
/
0
-------------
____
\/ pi
\mathrm{erf}(x) = \frac{2}{\sqrt{\pi}} \int_0^x e^{-t^2} \mathrm{d}t.
Examples
========
Expand Down Expand Up @@ -224,7 +207,8 @@ class erfc(Function):
r"""
Complementary Error Function. The function is defined as:
:math:`\mathrm{erfc}(x) = \frac{2}{\sqrt{\pi}} \int_x^\infty e^{-t^2} \mathrm{d}t`
.. math ::
\mathrm{erfc}(x) = \frac{2}{\sqrt{\pi}} \int_x^\infty e^{-t^2} \mathrm{d}t
Examples
========
Expand Down Expand Up @@ -404,7 +388,8 @@ class erfi(Function):
r"""
Imaginary error function. The function erfi is defined as:
:math:`\mathrm{erfi}(x) = \frac{2}{\sqrt{\pi}} \int_0^x e^{t^2} \mathrm{d}t`
.. math ::
\mathrm{erfi}(x) = \frac{2}{\sqrt{\pi}} \int_0^x e^{t^2} \mathrm{d}t
Examples
========
Expand Down Expand Up @@ -572,7 +557,8 @@ class erf2(Function):
r"""
Two-argument error function. This function is defined as:
:math:`\mathrm{erf2}(x, y) = \frac{2}{\sqrt{\pi}} \int_x^y e^{-t^2} \mathrm{d}t`
.. math ::
\mathrm{erf2}(x, y) = \frac{2}{\sqrt{\pi}} \int_x^y e^{-t^2} \mathrm{d}t
Examples
========
Expand Down Expand Up @@ -702,7 +688,8 @@ class erfinv(Function):
r"""
Inverse Error Function. The erfinv function is defined as:
:math:`\mathrm{erf}(x) = y \quad \Rightarrow \quad \mathrm{erfinv}(y) = x`
.. math ::
\mathrm{erf}(x) = y \quad \Rightarrow \quad \mathrm{erfinv}(y) = x
Examples
========
Expand Down Expand Up @@ -780,7 +767,8 @@ class erfcinv (Function):
r"""
Inverse Complementary Error Function. The erfcinv function is defined as:
:math:`\mathrm{erfc}(x) = y \quad \Rightarrow \quad \mathrm{erfcinv}(y) = x`
.. math ::
\mathrm{erfc}(x) = y \quad \Rightarrow \quad \mathrm{erfcinv}(y) = x
Examples
========
Expand Down Expand Up @@ -844,7 +832,8 @@ class erf2inv(Function):
r"""
Two-argument Inverse error function. The erf2inv function is defined as:
:math:`\mathrm{erf2}(x, w) = y \quad \Rightarrow \quad \mathrm{erf2inv}(x, y) = w`
.. math ::
\mathrm{erf2}(x, w) = y \quad \Rightarrow \quad \mathrm{erf2inv}(x, y) = w
Examples
========
Expand Down Expand Up @@ -963,26 +952,6 @@ class Ei(Function):
`x > 0`, and `|x|e^{i \arg(x)}`,
`|x|e^{- i \arg(x)}` denote two conjugate polar lifts of `x`.
See Also
========
expint: Generalised exponential integral.
E1: Special case of the generalised exponential integral.
li: Logarithmic integral.
Li: Offset logarithmic integral.
Si: Sine integral.
Ci: Cosine integral.
Shi: Hyperbolic sine integral.
Chi: Hyperbolic cosine integral.
sympy.functions.special.gamma_functions.uppergamma
References
==========
.. [1] http://dlmf.nist.gov/6.6
.. [2] http://en.wikipedia.org/wiki/Exponential_integral
.. [3] Abramowitz & Stegun, section 5: http://www.math.sfu.ca/~cbm/aands/page_228.htm
Examples
========
Expand Down Expand Up @@ -1026,6 +995,26 @@ class Ei(Function):
>>> Ei(x).rewrite(Shi)
Chi(x) + Shi(x)
See Also
========
expint: Generalised exponential integral.
E1: Special case of the generalised exponential integral.
li: Logarithmic integral.
Li: Offset logarithmic integral.
Si: Sine integral.
Ci: Cosine integral.
Shi: Hyperbolic sine integral.
Chi: Hyperbolic cosine integral.
sympy.functions.special.gamma_functions.uppergamma
References
==========
.. [1] http://dlmf.nist.gov/6.6
.. [2] http://en.wikipedia.org/wiki/Exponential_integral
.. [3] Abramowitz & Stegun, section 5: http://www.math.sfu.ca/~cbm/aands/page_228.htm
"""

nargs = 1
Expand Down Expand Up @@ -1104,26 +1093,6 @@ class expint(Function):
Refer to the incomplete gamma function documentation for details of the
branching behavior.
See Also
========
Ei: Another related function called exponential integral.
E1: The classical case, returns expint(1, z).
li: Logarithmic integral.
Li: Offset logarithmic integral.
Si: Sine integral.
Ci: Cosine integral.
Shi: Hyperbolic sine integral.
Chi: Hyperbolic cosine integral.
sympy.functions.special.gamma_functions.uppergamma
References
==========
.. [1] http://dlmf.nist.gov/8.19
.. [2] http://functions.wolfram.com/GammaBetaErf/ExpIntegralE/
.. [3] http://en.wikipedia.org/wiki/Exponential_integral
Examples
========
Expand Down Expand Up @@ -1177,6 +1146,26 @@ class expint(Function):
>>> expint(nu, z*exp_polar(2*pi*I))
z**(nu - 1)*(exp(2*I*pi*nu) - 1)*gamma(-nu + 1) + expint(nu, z)
See Also
========
Ei: Another related function called exponential integral.
E1: The classical case, returns expint(1, z).
li: Logarithmic integral.
Li: Offset logarithmic integral.
Si: Sine integral.
Ci: Cosine integral.
Shi: Hyperbolic sine integral.
Chi: Hyperbolic cosine integral.
sympy.functions.special.gamma_functions.uppergamma
References
==========
.. [1] http://dlmf.nist.gov/8.19
.. [2] http://functions.wolfram.com/GammaBetaErf/ExpIntegralE/
.. [3] http://en.wikipedia.org/wiki/Exponential_integral
"""

nargs = 2
Expand Down Expand Up @@ -1572,23 +1561,6 @@ class Si(TrigonometricIntegral):
It is an entire function.
See Also
========
Ci: Cosine integral.
Shi: Hyperbolic sine integral.
Chi: Hyperbolic cosine integral.
Ei: Exponential integral.
expint: Generalised exponential integral.
E1: Special case of the generalised exponential integral.
li: Logarithmic integral.
Li: Offset logarithmic integral.
References
==========
.. [1] http://en.wikipedia.org/wiki/Trigonometric_integral
Examples
========
Expand Down Expand Up @@ -1621,6 +1593,23 @@ class Si(TrigonometricIntegral):
-I*(-expint(1, z*exp_polar(-I*pi/2))/2 +
expint(1, z*exp_polar(I*pi/2))/2) + pi/2
See Also
========
Ci: Cosine integral.
Shi: Hyperbolic sine integral.
Chi: Hyperbolic cosine integral.
Ei: Exponential integral.
expint: Generalised exponential integral.
E1: Special case of the generalised exponential integral.
li: Logarithmic integral.
Li: Offset logarithmic integral.
References
==========
.. [1] http://en.wikipedia.org/wiki/Trigonometric_integral
"""

_trigfunc = C.sin
Expand Down Expand Up @@ -1667,23 +1656,6 @@ class Ci(TrigonometricIntegral):
By lifting to the principal branch we obtain an analytic function on the
cut complex plane.
See Also
========
Si: Sine integral.
Shi: Hyperbolic sine integral.
Chi: Hyperbolic cosine integral.
Ei: Exponential integral.
expint: Generalised exponential integral.
E1: Special case of the generalised exponential integral.
li: Logarithmic integral.
Li: Offset logarithmic integral.
References
==========
.. [1] http://en.wikipedia.org/wiki/Trigonometric_integral
Examples
========
Expand Down Expand Up @@ -1715,6 +1687,23 @@ class Ci(TrigonometricIntegral):
>>> Ci(z).rewrite(expint)
-expint(1, z*exp_polar(-I*pi/2))/2 - expint(1, z*exp_polar(I*pi/2))/2
See Also
========
Si: Sine integral.
Shi: Hyperbolic sine integral.
Chi: Hyperbolic cosine integral.
Ei: Exponential integral.
expint: Generalised exponential integral.
E1: Special case of the generalised exponential integral.
li: Logarithmic integral.
Li: Offset logarithmic integral.
References
==========
.. [1] http://en.wikipedia.org/wiki/Trigonometric_integral
"""

_trigfunc = C.cos
Expand Down Expand Up @@ -1744,23 +1733,6 @@ class Shi(TrigonometricIntegral):
It is an entire function.
See Also
========
Si: Sine integral.
Ci: Cosine integral.
Chi: Hyperbolic cosine integral.
Ei: Exponential integral.
expint: Generalised exponential integral.
E1: Special case of the generalised exponential integral.
li: Logarithmic integral.
Li: Offset logarithmic integral.
References
==========
.. [1] http://en.wikipedia.org/wiki/Trigonometric_integral
Examples
========
Expand Down Expand Up @@ -1792,6 +1764,23 @@ class Shi(TrigonometricIntegral):
>>> Shi(z).rewrite(expint)
expint(1, z)/2 - expint(1, z*exp_polar(I*pi))/2 - I*pi/2
See Also
========
Si: Sine integral.
Ci: Cosine integral.
Chi: Hyperbolic cosine integral.
Ei: Exponential integral.
expint: Generalised exponential integral.
E1: Special case of the generalised exponential integral.
li: Logarithmic integral.
Li: Offset logarithmic integral.
References
==========
.. [1] http://en.wikipedia.org/wiki/Trigonometric_integral
"""

_trigfunc = C.sinh
Expand Down Expand Up @@ -1834,23 +1823,6 @@ class Chi(TrigonometricIntegral):
By lifting to the principal branch we obtain an analytic function on the
cut complex plane.
See Also
========
Si: Sine integral.
Ci: Cosine integral.
Shi: Hyperbolic sine integral.
Ei: Exponential integral.
expint: Generalised exponential integral.
E1: Special case of the generalised exponential integral.
li: Logarithmic integral.
Li: Offset logarithmic integral.
References
==========
.. [1] http://en.wikipedia.org/wiki/Trigonometric_integral
Examples
========
Expand Down Expand Up @@ -1882,6 +1854,23 @@ class Chi(TrigonometricIntegral):
>>> Chi(z).rewrite(expint)
-expint(1, z)/2 - expint(1, z*exp_polar(I*pi))/2 - I*pi/2
See Also
========
Si: Sine integral.
Ci: Cosine integral.
Shi: Hyperbolic sine integral.
Ei: Exponential integral.
expint: Generalised exponential integral.
E1: Special case of the generalised exponential integral.
li: Logarithmic integral.
Li: Offset logarithmic integral.
References
==========
.. [1] http://en.wikipedia.org/wiki/Trigonometric_integral
"""

_trigfunc = C.cosh
Expand Down

0 comments on commit e5dbc80

Please sign in to comment.