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

Commit

Permalink
21819: address reviewer's comments; maxima erfc bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
rwst committed Nov 10, 2016
1 parent 801c42a commit 3c5739e
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions src/sage/functions/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
AUTHORS:
* Original authors `erf`/`error_fcn` (c) 2006-2014:
* Original authors ``erf``/``error_fcn`` (c) 2006-2014:
Karl-Dieter Crisman, Benjamin Jones, Mike Hansen, William Stein,
Burcin Erocal, Jeroen Demeyer, W. D. Joyner, R. Andrew Ohana
* Reorganisation in new file, addition of `erfi`/`erfinv`/`erfc` (c) 2016:
Ralf Stephan
* Reorganisation in new file, addition of ``erfi``/``erfinv``/``erfc``
(c) 2016: Ralf Stephan
REFERENCES:
Expand Down Expand Up @@ -47,12 +47,13 @@
from sage.functions.all import sqrt, exp
from sage.symbolic.constants import pi
from sage.rings.infinity import unsigned_infinity
from sage.misc.superseded import deprecation

class Function_erf(BuiltinFunction):
r"""
The error function, defined for real values as
`\text{erf}(x) = \frac{2}{\sqrt{\pi}} \int_0^x e^{-t^2} dt`.
`\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.
Expand Down Expand Up @@ -441,7 +442,24 @@ def _derivative_(self, x, diff_param=None):
"""
return -2*exp(-x**2)/sqrt(pi)

error_fcn = erfc = Function_erfc()
erfc = Function_erfc()

def error_fcn(x):
"""
Deprecated. Please use erfc().
EXAMPLES::
sage: error_fcn(x)
doctest:warning
...
DeprecationWarning: error_fcn() is deprecated. Please use erfc()
See http://trac.sagemath.org/21819 for details.
erfc(x)
"""
deprecation(21819, "error_fcn() is deprecated. Please use erfc()")
return erfc(x)


class Function_erfinv(BuiltinFunction):
def __init__(self):
Expand All @@ -453,10 +471,13 @@ def __init__(self):
sage: erfinv(2)._sympy_()
erfinv(2)
sage: maxima(erfinv(2))
inverse_erf(2)
"""
BuiltinFunction.__init__(self, "erfinv",
latex_name=r"\operatorname{erfinv}",
conversions=dict(sympy='erfinv'))
conversions=dict(sympy='erfinv',
maxima='inverse_erf'))

def _eval_(self, x):
"""
Expand Down

0 comments on commit 3c5739e

Please sign in to comment.