polyval#

ivy.polyval(coeffs, x)[source]#

Evaluate and return a polynomial at specific given values.

Parameters:
  • coeffs (Union[Array, NativeArray]) – Polynomial coefficients (including zero) from highest degree to constant term.

  • x (Union[Array, NativeArray]) – The value of the indeterminate variable at which to evaluate the polynomial.

Returns:

ret – Simplified result of substituting x in the coefficients - final value of polynomial.

Examples

>>> ivy.polyval([3, 0, 1], 5)
ivy.array(76)
Container.polyval(self, coeffs, x)[source]#

ivy.Container instance method variant of ivy.polyval. This method simply wraps the function, and so the docstring for ivy.polyval also applies to this method with minimal changes.

Evaluate and return a polynomial at specific given values.

Parameters:
  • self (Container) – Arbitrary input container

  • coeffs (Container) – Polynomial coefficients (including zero) from highest degree to constant term.

  • x (Container) – The value of the indeterminate variable at which to evaluate the polynomial.

Return type:

Container

Returns:

ret – Output container containing simplified result of substituting x in the coefficients - final value of polynomial.