From b5c08642c7f725783316ef4e84b068040749d434 Mon Sep 17 00:00:00 2001 From: Ralf Stephan Date: Fri, 26 May 2017 08:24:23 +0200 Subject: [PATCH] 23077: fix jacobi_P numerics --- src/sage/functions/orthogonal_polys.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sage/functions/orthogonal_polys.py b/src/sage/functions/orthogonal_polys.py index 931b247ba5f..51da3780d65 100644 --- a/src/sage/functions/orthogonal_polys.py +++ b/src/sage/functions/orthogonal_polys.py @@ -1942,7 +1942,10 @@ def _evalf_(self, n, a, b, x, **kwds): prec = the_parent.precision() BF = CBF(prec+5) ret = BF(x).jacobi_P(BF(n), BF(a), BF(b)) - return the_parent(ret) + try: + return the_parent(ret) + except (TypeError, ValueError): + return the_parent.complex_field()(ret) jacobi_P = Func_jacobi_P()