numpy 1.22.4 Pypi GitHub Homepage
Other Docs
NotesParametersReturnsBackRef
hermval(x, c, tensor=True)

If c is of length :None:None:`n + 1`, this function returns the value:

$$p(x) = c_0 * H_0(x) + c_1 * H_1(x) + ... + c_n * H_n(x)$$

The parameter x is converted to an array only if it is a tuple or a list, otherwise it is treated as a scalar. In either case, either x or its elements must support multiplication and addition both with themselves and with the elements of c.

If c is a 1-D array, then :None:None:`p(x)` will have the same shape as x. If c is multidimensional, then the shape of the result depends on the value of :None:None:`tensor`. If :None:None:`tensor` is true the shape will be c.shape[1:] + x.shape. If :None:None:`tensor` is false the shape will be c.shape[1:]. Note that scalars have shape (,).

Trailing zeros in the coefficients will be used in the evaluation, so they should be avoided if efficiency is a concern.

Notes

The evaluation uses Clenshaw recursion, aka synthetic division.

Parameters

x : array_like, compatible object

If x is a list or tuple, it is converted to an ndarray, otherwise it is left unchanged and treated as a scalar. In either case, x or its elements must support addition and multiplication with with themselves and with the elements of c.

c : array_like

Array of coefficients ordered so that the coefficients for terms of degree n are contained in c[n]. If c is multidimensional the remaining indices enumerate multiple polynomials. In the two dimensional case the coefficients may be thought of as stored in the columns of c.

tensor : boolean, optional

If True, the shape of the coefficient array is extended with ones on the right, one for each dimension of x. Scalars have dimension 0 for this action. The result is that every column of coefficients in c is evaluated for every element of x. If False, x is broadcast over the columns of c for the evaluation. This keyword is useful when c is multidimensional. The default value is True.

versionadded

Returns

values : ndarray, algebra_like

The shape of the return value is described above.

Evaluate an Hermite series at points x.

See Also

hermgrid2d
hermgrid3d
hermval2d
hermval3d

Examples

>>> from numpy.polynomial.hermite import hermval
... coef = [1,2,3]
... hermval(1, coef) 11.0
>>> hermval([[1,2],[3,4]], coef)
array([[ 11.,   51.],
       [115.,  203.]])
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

numpy.polynomial.hermite.hermgrid2d numpy.polynomial.hermite.hermval3d numpy.polynomial.hermite.hermfit numpy.polynomial.hermite.hermgrid3d numpy.polynomial.hermite.hermval2d

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/polynomial/hermite.py#802
type: <class 'function'>
Commit: