| • Science | • People | • Locations | • Timeline |
Even though it is named after William George Horner, who described the algorithm in 1819, it was already known to Isaac Newton in 1669 and even to the Chinese mathematician Ch'in Chiu-Shao around 1200s.
Assume we want to evaluate the polynomial in the monomial form
for given a0,...,an. That is we want to know
for a given x. When using the monomial form of the polynomial we we need n additions and n2+n/2 multiplications for the calculation of p(x). Our aim is to decrease the number of multplications because they are slow and numerically instable compared to the additions. The Horner algorithm rearranges the polynomial into the recursive form
and then evalutes the polynomial recursivly using only n additions and n mulitplications. Additionally it is numerically more stable because we eliminated some multiplications. Alternatively it could be computed with n fused multiply-adds.
Given the polynomial
we rearrange it into
Then starting from the innermost parentheses and working outwards we define
If we put the bn in the polynomial we see that
so b0 is the is the value of the polynomial p at x.
The Horner scheme is often used to convert between different positional numeral systemA numeral is a symbol or group of symbols that represents a number. Numerals differ from numbers just as words differ from the things they refer to. The symbols "11", "eleven" and "XI" are different numerals, all representing the same number. This articles (in which case x is the base of the number system, and the ai are the digits) and can also be used if x is a matrix, in which case the gain is even larger.
The Horner scheme can also be viewed as a fast algorithm for dividing a polynomial by a linear polynomial (see Ruffini's ruleIn mathematics, Ruffini's rule allows the rapid division of any polynomial by a binomial of the form x − r''. It was described by Paolo Ruffini in 1809. Ruffini's rule is a special case of long division when the divisor is a linear factor. Ruffini's).