horner.poly: Evaluate Polynomial and Rational Functions using Horner's...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/horner.R

Description

Calculate

Usage

1
2
3

Arguments

x

a vector

P

the coefficients of the polynomial in the numerator, in increasing order

Q

the coefficients of the polynomial in the denominator

Details

y = (P_1 + P_2*x + P_3*x^2 + ... ) / ( Q_1 + Q_2*x + Q_3*x^2 + ...)

If the coefficients have zeros as highest powers, those are ignored.

Value

a vector

Author(s)

torvin

References

https://stackoverflow.com/questions/53256945/evaluate-polynominal-function

Examples

1
2
P <- c(1,-2,1)
horner.poly(polyroot(P), P)

stackoverflow documentation built on Jan. 10, 2020, 9:07 a.m.