Polynomials
Polynomial arithmetic, calculus, evaluation, and fitting.
poly
Construct a polynomial from its roots.
poly(roots) → r
polyadd
Add two polynomials element-wise.
polyadd(a, b) → r
polyder
Compute the first derivative of a polynomial.
polyder(p) → r
polydiv
Divide polynomial u by v. Returns a tuple (quotient, remainder).
polydiv(u, v) → r
polyfit
Least-squares polynomial fit of the given degree.
polyfit(x, y, deg) → r
polyint
Compute the antiderivative (indefinite integral) of a polynomial.
polyint(p) → r
polymul
Multiply two polynomials (convolution of coefficients).
polymul(a, b) → r
polysub
Subtract polynomial b from a.
polysub(a, b) → r
polyval
Evaluate a polynomial at given point(s).
polyval(coeffs, x) → r