Repository: sympy/sympy

Issue:
Applying evalf to an expression with uppergamma(3/8, x) raises ValueError
`x**(3/4)*(-(-I*uppergamma(3/8, -I*x**2) + I*uppergamma(3/8, I*x**2))*cos(3*pi/16)/8 - (uppergamma(3/8, -I*x**2) + uppergamma(3/8, I*x**2))*sin(3*pi/16)/8)/(x**2)**(3/8) - (-(-I*uppergamma(3/8, -I*x**32) + I*uppergamma(3/8, I*x**32))*cos(3*pi/16)/8 - (uppergamma(3/8, -I*x**32) + uppergamma(3/8, I*x**32))*sin(3*pi/16)/8)*(x**8)**(3/2)/(x**32)**(3/8).evalf()` raises `ValueError`

Discussion:

Patch:
diff --git a/README.rst b/README.rst
index 907949775f..0e3531794c 100644
--- a/README.rst
+++ b/README.rst
@@ -36,10 +36,7 @@ to ask us anything there. We have a very welcoming and helpful community.
 Download
 --------
 
-The recommended installation method is through Anaconda,
-https://www.anaconda.com/download/
-
-You can also get the latest version of SymPy from
+Get the latest version of SymPy from
 https://pypi.python.org/pypi/sympy/
 
 To get the git version do
@@ -150,6 +147,16 @@ After making changes to `sympy/parsing/latex/LaTeX.g4`, run::
 
     $ ./setup.py antlr
 
+Usage in Python 3
+-----------------
+
+SymPy also supports Python 3. If you want to install the latest version in
+Python 3, get the Python 3 tarball from
+https://pypi.python.org/pypi/sympy/
+
+To install the SymPy for Python 3, simply run the above commands with a Python
+3 interpreter.
+
 Clean
 -----
 
diff --git a/doc/src/install.rst b/doc/src/install.rst
index 47d1dc8835..32bfa8f6a7 100644
--- a/doc/src/install.rst
+++ b/doc/src/install.rst
@@ -5,16 +5,17 @@ Installation
 
 The SymPy CAS can be installed on virtually any computer with Python 2.7 or
 above. SymPy does require `mpmath`_ Python library to be installed first.  The
-recommended method of installation is through Anaconda, which includes
-mpmath, as well as several other useful libraries.  Alternatively, some Linux
-distributions have SymPy packages available.
+current recommended method of installation is through Anaconda, which includes
+mpmath, as well as several other useful libraries.  Alternatively, executables
+are available for Windows, and some Linux distributions have SymPy packages
+available.
 
 SymPy officially supports Python 2.7, 3.4, 3.5, 3.6 and PyPy.
 
 Anaconda
 ========
 
-`Anaconda <https://www.anaconda.com/download/>`_ is a free Python distribution from
+`Anaconda <http://continuum.io/downloads>`_ is a free Python distribution from
 Continuum Analytics that includes SymPy, Matplotlib, IPython, NumPy, and many
 more useful packages for scientific computing. This is recommended because
 many nice features of SymPy are only enabled when certain libraries are
@@ -51,8 +52,9 @@ directory.
 Other Methods
 =============
 
-Various Linux distributions have SymPy available as a package. You may also
-install SymPy from source or using pip.
+An installation executable (.exe) is available for Windows users at the
+`downloads site`_. In addition, various Linux distributions have SymPy
+available as a package. You may also install SymPy from source or using pip.
 
 Run SymPy
 =========
diff --git a/sympy/functions/special/gamma_functions.py b/sympy/functions/special/gamma_functions.py
index baba6ac71b..64013b1665 100644
--- a/sympy/functions/special/gamma_functions.py
+++ b/sympy/functions/special/gamma_functions.py
@@ -305,11 +305,14 @@ def eval(cls, a, x):
     def _eval_evalf(self, prec):
         from mpmath import mp, workprec
         from sympy import Expr
-        a = self.args[0]._to_mpmath(prec)
-        z = self.args[1]._to_mpmath(prec)
-        with workprec(prec):
-            res = mp.gammainc(a, 0, z)
-        return Expr._from_mpmath(res, prec)
+        if all(x.is_number for x in self.args):
+            a = self.args[0]._to_mpmath(prec)
+            z = self.args[1]._to_mpmath(prec)
+            with workprec(prec):
+                res = mp.gammainc(a, 0, z)
+            return Expr._from_mpmath(res, prec)
+        else:
+            return self
 
     def _eval_conjugate(self):
         z = self.args[1]
@@ -401,11 +404,13 @@ def fdiff(self, argindex=2):
     def _eval_evalf(self, prec):
         from mpmath import mp, workprec
         from sympy import Expr
-        a = self.args[0]._to_mpmath(prec)
-        z = self.args[1]._to_mpmath(prec)
-        with workprec(prec):
-            res = mp.gammainc(a, z, mp.inf)
-        return Expr._from_mpmath(res, prec)
+        if all(x.is_number for x in self.args):
+            a = self.args[0]._to_mpmath(prec)
+            z = self.args[1]._to_mpmath(prec)
+            with workprec(prec):
+                res = mp.gammainc(a, z, mp.inf)
+            return Expr._from_mpmath(res, prec)
+        return self
 
     @classmethod
     def eval(cls, a, z):


Test patch:
diff --git a/sympy/functions/special/tests/test_gamma_functions.py b/sympy/functions/special/tests/test_gamma_functions.py
index 74508fc319..72c059d61a 100644
--- a/sympy/functions/special/tests/test_gamma_functions.py
+++ b/sympy/functions/special/tests/test_gamma_functions.py
@@ -433,3 +433,10 @@ def test_issue_8524():
     assert gamma(r).is_positive is None
     assert gamma(e + S.Half).is_positive is True
     assert gamma(e - S.Half).is_positive is False
+
+def test_issue_14450():
+    assert uppergamma(3/8, x).evalf() == uppergamma(0.375, x)
+    assert lowergamma(x, 3/8).evalf() == lowergamma(x, 0.375)
+    # some values from Wolfram Alpha for comparison
+    assert abs(uppergamma(S(3)/8, 2).evalf() - 0.07105675881) < 1e-9
+    assert abs(lowergamma(S(3)/8, 2).evalf() - 2.2993794256) < 1e-9