Evaluate a polynomial at sample points.
Numeric.poly.evaluate(sample, coefficients, basis = 'poly')Computes polynomial values using Horner iteration.
- Parameters:
sample: Point or points where the polynomial is evaluatedcoefficients: Coefficients of the source polynomialbasis: Polynomial basis, roots mode, boolean flag, or coefficient matrixsurface: Polynomial basis for two-dimensional evaluation or tensor flag
- Returns: Polynomial values at the sample points
- NumPy: Covers
np.polynomial.polynomial.polyval,np.polynomial.polynomial.polyval2d,np.polynomial.polynomial.polyval3d,np.polynomial.polynomial.polyvalnd,np.polynomial.polynomial.polyvalfromroots,np.polynomial.chebyshev.chebval,np.polynomial.legendre.legval,np.polynomial.hermite.hermval,np.polynomial.hermite_e.hermeval,np.polynomial.laguerre.lagval,np.polyvalthrough a single Numerix method.
import Numeric from '@neabyte/numerix'
const value = Numeric.poly.evaluate(2, [1, 2, 3])
console.log(value)
// 17import Numeric from '@neabyte/numerix'
const values = Numeric.poly.evaluate([1, 2], [1, 2, 3])
console.log(values)
// [6,17]import Numeric from '@neabyte/numerix'
const value = Numeric.poly.evaluate(0, [1, 2, 3])
console.log(value)
// 1import Numeric from '@neabyte/numerix'
const value = Numeric.poly.evaluate(5, [7])
console.log(value)
// 7