# [Scipy-tickets] [SciPy] #1298: Orthogonal polynomials return infinity when evaluated at -1

SciPy Trac scipy-tickets@scipy....
Fri Nov 26 21:50:24 CST 2010

```#1298: Orthogonal polynomials return infinity when evaluated at -1
---------------------------+------------------------------------------------
Reporter:  joelphillips   |       Owner:  pv
Type:  defect         |      Status:  new
Priority:  high           |   Milestone:  0.9.0
Component:  scipy.special  |     Version:  0.8.0
Keywords:                 |
---------------------------+------------------------------------------------

Old description:

> In scipy.special.orthogonal, legendre and jacobi both return infinity
> when evaluated at -1 for all orders greater than or equal to 1.  This is
> incorrect!
>
> Problem only seems to exist at -1.
>
> Example below:
>
> smmc8:~ joel\$
> /Library/Frameworks/Python.framework/Versions/2.7/bin/ipython
> Python 2.7 (r27:82508, Jul  3 2010, 21:12:11)
>
> IPython 0.10 -- An enhanced Interactive Python.
> ?         -> Introduction and overview of IPython's features.
> %quickref -> Quick reference.
> help      -> Python's own help system.
> object?   -> Details about 'object'. ?object also works, ?? prints more.
>
> In [1]: import scipy
>
> In [2]: scipy.version.version
> Out[2]: '0.8.0'
>
> In [3]: import scipy.special.orthogonal as sso
>
> In [4]: sso.legendre(1)(-1)
> Out[4]: inf
>
> In [5]: sso.jacobi(3,4,5)(-1)
> Out[5]: inf
>
> In [6]: sso.legendre(1)(-0.999999)
> Out[7]: -0.99999899999999986

New description:

In scipy.special.orthogonal, legendre and jacobi both return infinity when
evaluated at -1 for all orders greater than or equal to 1.  This is
incorrect!

Problem only seems to exist at -1.

Example below:
{{{
smmc8:~ joel\$
/Library/Frameworks/Python.framework/Versions/2.7/bin/ipython
Python 2.7 (r27:82508, Jul  3 2010, 21:12:11)

IPython 0.10 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object'. ?object also works, ?? prints more.

In [1]: import scipy

In [2]: scipy.version.version
Out[2]: '0.8.0'

In [3]: import scipy.special.orthogonal as sso

In [4]: sso.legendre(1)(-1)
Out[4]: inf

In [5]: sso.jacobi(3,4,5)(-1)
Out[5]: inf

In [6]: sso.legendre(1)(-0.999999)
Out[7]: -0.99999899999999986
}}}

--

Comment(by warren.weckesser):

Add markup to quote the ipython session.

--
Ticket URL: <http://projects.scipy.org/scipy/ticket/1298#comment:2>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.
```