public class Polynomial extends java.lang.Object
|Modifier||Constructor and Description|
Don't allow instantiation but do allow overrides.
|Modifier and Type||Method and Description|
Evaluates a Chebyschev series.
Evaluate a polynomial expression using Horner's method.
public static double hornersMethod(double polycoefs, double x)
polycoefs- Array of polynomial coefficients. The coefficients should be ordered with the constant term first and the coefficient for the highest powered term last.
x- Value for which to evaluate polynomial.
Horner's method is given by the following recurrence relation: c[i]*x^i + ... + c*x + c = c + x*(c[i-1]*x^[i-1] + ... + c)
Horner's method avoids loss of precision which can occur when the higher-power values of x are computed directly.
public static double evaluateChebyschev(double coeffs, double x)
coeffs- The Chebyschev polynomial coefficients.
x- The value for which to evaluate the polynomial.