Evaluate a polynomial.
If cs is of length n, this function returns :
p(x) = cs[0] + cs[1]*x + ... + cs[n-1]*x**(n-1)
If x is a sequence or array then p(x) will have the same shape as x. If r is a ring_like object that supports multiplication and addition by the values in cs, then an object of the same type is returned.
Parameters : | x : array_like, ring_like
cs : array_like
|
---|---|
Returns : | values : ndarray
|
See also
Notes
The evaluation uses Horner’s method.