Description Usage Arguments Details Value See Also Examples
Use Horner's rule to evaluate a polynomial
1 2 3 4 5 6 7 | horner(x, coefs)
rhorner(x, coefs)
naivepoly(x, coefs)
betterpoly(x, coefs)
|
x |
a vector of x values to evaluate the polynomial |
coefs |
vector of coefficients of x |
This function implements Horner's rule for fast polynomial
evaluation. The implementation expects x
to be a vector of x
values at which to evaluate the polynomial. The parameter coefs
is a vector of coefficients of x. The vector order is such
that the first element is the constant term, the second element is
the coefficient of x, the so forth to the highest degreed
term. Terms with a 0 coefficient should have a 0 element in the
vector.
The function rhorner
implements the the Horner algorithm
recursively.
The function naivepoly
implements a polynomial evaluator using
the straightforward algebraic approach.
The function betterpoly
implements a polynomial evaluator using
the straightforward algebraic approach with cached x terms.
the value of the function at x
Other algebra:
bilinear()
,
cubicspline()
,
division
,
fibonacci()
,
isPrime()
,
linterp()
,
nthroot()
,
polyinterp()
,
pwiselinterp()
,
quadratic()
1 2 3 4 5 6 7 |
[1] 327
[1] 0 3 8 15
[1] 0 3 8 15
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.