public class HornerScheme extends Object
P(x) = Q(x)(x - x0) + P(x0)We thus can compute the value of a polynomial P(x) at x0, i.e., P(x0), and at the same time the quotient Q(x).
Constructor and Description |
---|
HornerScheme(Polynomial polynomial,
double x)
Evaluate a polynomial at x.
|
Modifier and Type | Method and Description |
---|---|
Polynomial |
quotient()
Get the quotient, Q(x).
|
double |
remainder()
Get the remainder, P(x0).
|
public HornerScheme(Polynomial polynomial, double x)
polynomial
- a polynomialx
- a point to evaluate the polynomial atpublic double remainder()
public Polynomial quotient()
Copyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.