Did I find the right examples for you? yes no

# numpy.polynomial.hermite_e.hermeroots

All Samples(6)  |  Call(6)  |  Derive(0)  |  Import(0)
Compute the roots of a HermiteE series.

Return the roots (a.k.a. "zeros") of the polynomial

.. math:: p(x) = \sum_i c[i] * He_i(x).

Parameters
----------
c : 1-D array_like
1-D array of coefficients.(more...)


        def hermeroots(c):
"""
Compute the roots of a HermiteE series.

Return the roots (a.k.a. "zeros") of the polynomial

.. math:: p(x) = \\sum_i c[i] * He_i(x).

Parameters
----------
c : 1-D array_like
1-D array of coefficients.

Returns
-------
out : ndarray
Array of the roots of the series. If all the roots are real,
then out is also real, otherwise it is complex.

--------
polyroots, legroots, lagroots, hermroots, chebroots

Notes
-----
The root estimates are obtained as the eigenvalues of the companion
matrix, Roots far from the origin of the complex plane may have large
errors due to the numerical instability of the series for such
values. Roots with multiplicity greater than 1 will also show larger
errors as the value of the series near such points is relatively
insensitive to errors in the roots. Isolated roots near the origin can
be improved by a few iterations of Newton's method.

The HermiteE series basis polynomials aren't powers of x so the
results of this function may seem unintuitive.

Examples
--------
>>> from numpy.polynomial.hermite_e import hermeroots, hermefromroots
>>> coef = hermefromroots([-1, 0, 1])
>>> coef
array([ 0.,  2.,  0.,  1.])
>>> hermeroots(coef)
array([-1.,  0.,  1.])

"""
# c is a trimmed copy
[c] = pu.as_series([c])
if len(c) <= 1 :
return np.array([], dtype=c.dtype)
if len(c) == 2 :
return np.array([-c[0]/c[1]])

m = hermecompanion(c)
r = la.eigvals(m)
r.sort()
return r


    def test_hermeroots(self) :
assert_almost_equal(herme.hermeroots([1]), [])
assert_almost_equal(herme.hermeroots([1, 1]), [-1])
for i in range(2,5) :
tgt = np.linspace(-1, 1, i)
res = herme.hermeroots(herme.hermefromroots(tgt))


    def test_hermeroots(self) :