Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Some small tweaks to the doc.
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Scrimshaw committed May 16, 2017
1 parent df32cc6 commit 1eac4d8
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 22 deletions.
64 changes: 43 additions & 21 deletions src/sage/functions/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,12 @@
"""

#*****************************************************************************
# Distributed under the terms of the GNU General Public License (GPL)
#
# This code is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# The full text of the GPL is available at:
# Copyright (C) 2016 Ralf Stephan <gtrwst9 at gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
# http://www.gnu.org/licenses/
#*****************************************************************************

Expand All @@ -50,14 +47,17 @@

class Function_erf(BuiltinFunction):
r"""
The error function, defined for real values as
The error function.
The error function is defined for real values as
`\operatorname{erf}(x) = \frac{2}{\sqrt{\pi}} \int_0^x e^{-t^2} dt`.
.. MATH::
\operatorname{erf}(x) = \frac{2}{\sqrt{\pi}} \int_0^x e^{-t^2} dt.
This function is also defined for complex values, via analytic
continuation.
EXAMPLES:
We can evaluate numerically::
Expand Down Expand Up @@ -86,7 +86,7 @@ class Function_erf(BuiltinFunction):
REFERENCES:
- http://en.wikipedia.org/wiki/Error_function
- :wikipedia:`Error_function`
- http://mpmath.googlecode.com/svn/trunk/doc/build/functions/expintegrals.html#error-functions
TESTS:
Expand Down Expand Up @@ -264,7 +264,7 @@ def _evalf_(self, x, parent=None, algorithm=None):

def _derivative_(self, x, diff_param=None):
"""
Derivative of erf function
Derivative of erf function.
EXAMPLES::
Expand All @@ -287,10 +287,18 @@ def _derivative_(self, x, diff_param=None):
erf = Function_erf()

class Function_erfi(BuiltinFunction):
"""
The imaginary error function.
The imaginary error function is defined by
.. MATH::
\operatorname{erfi}(x) = -i \operatorname{erf}(ix).
"""
def __init__(self):
r"""
The imaginary error function
`\operatorname{erfi}(x)=-i\operatorname{erf}(ix)`.
Initialize ``self``.
EXAMPLES::
Expand Down Expand Up @@ -357,8 +365,13 @@ def _derivative_(self, x, diff_param=None):

class Function_erfc(BuiltinFunction):
r"""
The complementary error function
`\frac{2}{\sqrt{\pi}}\int_t^\infty e^{-x^2} dx`.
The complementary error function.
The complementary error function is defined by
.. MATH::
\frac{2}{\sqrt{\pi}} \int_t^\infty e^{-x^2} dx.
EXAMPLES::
Expand Down Expand Up @@ -445,10 +458,18 @@ def _derivative_(self, x, diff_param=None):


class Function_erfinv(BuiltinFunction):
"""
The inverse error function.
The inverse error function is defined by:
.. MATH::
\operatorname{erfinv}(x) = \operatorname{erf}^{-1}(x).
"""
def __init__(self):
r"""
The inverse error function
`\operatorname{erfinv}(x)=\operatorname{erf}^{-1}(x)`.
Initialize ``self``.
EXAMPLES::
Expand All @@ -460,7 +481,7 @@ def __init__(self):
BuiltinFunction.__init__(self, "erfinv",
latex_name=r"\operatorname{erfinv}",
conversions=dict(sympy='erfinv',
maxima='inverse_erf'))
maxima='inverse_erf'))

def _eval_(self, x):
"""
Expand Down Expand Up @@ -498,7 +519,7 @@ def _evalf_(self, x, parent=None, algorithm=None):

def _derivative_(self, x, diff_param=None):
"""
Derivative of inverse erf function
Derivative of inverse erf function.
EXAMPLES::
Expand All @@ -511,3 +532,4 @@ def _derivative_(self, x, diff_param=None):

from sage.structure.sage_object import register_unpickle_override
register_unpickle_override('sage.functions.other', 'Function_erf', Function_erf)

3 changes: 2 additions & 1 deletion src/sage/functions/special.py
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ def _print_latex_(self, n, z, m):

def error_fcn(x):
"""
Deprecated. Please use erfc().
Deprecated in :trac:21819`. Please use ``erfc()``.
EXAMPLES::
Expand All @@ -1030,3 +1030,4 @@ def error_fcn(x):
from sage.misc.superseded import deprecation
deprecation(21819, "error_fcn() is deprecated. Please use erfc()")
return erfc(x)

0 comments on commit 1eac4d8

Please sign in to comment.