MCPcopy Create free account
hub / github.com/numpy/numpy / _normed_hermite_e_n

Function _normed_hermite_e_n

numpy/polynomial/hermite_e.py:1509–1549  ·  view source on GitHub ↗

Evaluate a normalized HermiteE polynomial. Compute the value of the normalized HermiteE polynomial of degree ``n`` at the points ``x``. Parameters ---------- x : ndarray of double. Points at which to evaluate the function n : int Degree of the normaliz

(x, n)

Source from the content-addressed store, hash-verified

1507
1508
1509def _normed_hermite_e_n(x, n):
1510 """
1511 Evaluate a normalized HermiteE polynomial.
1512
1513 Compute the value of the normalized HermiteE polynomial of degree ``n``
1514 at the points ``x``.
1515
1516
1517 Parameters
1518 ----------
1519 x : ndarray of double.
1520 Points at which to evaluate the function
1521 n : int
1522 Degree of the normalized HermiteE function to be evaluated.
1523
1524 Returns
1525 -------
1526 values : ndarray
1527 The shape of the return value is described above.
1528
1529 Notes
1530 -----
1531 .. versionadded:: 1.10.0
1532
1533 This function is needed for finding the Gauss points and integration
1534 weights for high degrees. The values of the standard HermiteE functions
1535 overflow when n >= 207.
1536
1537 """
1538 if n == 0:
1539 return np.full(x.shape, 1/np.sqrt(np.sqrt(2*np.pi)))
1540
1541 c0 = 0.
1542 c1 = 1./np.sqrt(np.sqrt(2*np.pi))
1543 nd = float(n)
1544 for i in range(n - 1):
1545 tmp = c0
1546 c0 = -c1*np.sqrt((nd - 1.)/nd)
1547 c1 = tmp + c1*x*np.sqrt(1./nd)
1548 nd = nd - 1.0
1549 return c0 + c1*x
1550
1551
1552def hermegauss(deg):

Callers 1

hermegaussFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected