Everything2
Near Matches
Ignore Exact
Full Text
Everything2

Horner's rule

created by elluzion

(idea) by elluzion (19.3 hr) (print)   ?   (I like it!) 1 C! Thu Dec 20 2001 at 19:24:55

In math-speak:

A polynomial A(x) = a0 + a1x + a2x2 + a3x3 + ... may be written as A(x) = a0 + x(a1 + x(a2 + x(a3 + ...))).

In english:

(well, mostly English)

A polynomial may be evaluated at a point x', that is A(x') computed, in Θ* time using Horner's rule. That is, repeated multiplications and additions, rather than the naive methods of raising x to powers, multiplying by the coefficient, and accumulating.


* Θ (Theta) is commonly used as a symbol signifying the execution of an algorithm, usually in terms of time or memory required.

(idea) by felixc112 (1.2 mon) (print)   ?   (I like it!) Sat Oct 12 2002 at 4:45:26

Horner's Method, also know as Horner's rule, is a method for calculating the value of any nth degree polynomial using only n multiplications and n additions. This is achieved through gratuitous use of the properties of distribution and associativity. It was William Horner's only significant contribution to the realm of mathematics, first submitted to the Royal Society in July 1, 1819. He was not however not the first mathematician to have developed it. Original credit goes to Chu Shih-Chieh, who had known of it approximately 500 years earlier.

Essentially, this rule provides an efficient computational method for calculating the value of a polynomial. The nth degree polynomial is most commonly written as:

f(x) = anxn + an-1xn-1 + ... + a1x + a0

Rather than unnecessarily recompute the powers of x repeatedly, we start from the highest coefficient and work our way down, repeatedly multiplying by x, what this gives us is:

f(x) = ((((((anx + an-1)x + an-2)x) ... + a1)x + a0

The following C function will also compute the value of a polynomial using Horner's Method:

double Horners (double coef [ ], int degree, double x)
{

double y;
int i;

y = coef [degree];

for (i = degree - 1; i >= 0; i--)
y = y * x + coef [i];

return y;
}

The really cool thing about Horner's rule is that it allows us to parallelize the computation. By using multiple variables to store the values, we can compute the polynomial by multiplying by some small power of x rather than using x itself. Say we use two temporary variables, the first will store the computation for every even power of x, and the second for every odd power. Since the two are not dependent on each other, we can do both at once, and then add the result at the end.

printable version
chaos

Math is hard Polynomial Paraavartya Yojayet Calculus
Horner's Method exponent Words and Expressions Commonly Misused Wet nurse
theta algorithm f(x) algebra
Sturm's theorem
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
The best nodes of all time:
Newton's Rape Manual and other surprises
Elder Futhark
How I made the Year Nodes
My small mark on the world
Hedwig and the Angry Inch
Books
asthma
weird radio, deserts, ghost towns, diesel moons
The Pig War
Now I ask you, is that any way for a cosmic body to disintegrate?
Dmitri Shostakovich
Music of the Spheres
Samurai
New Writeups
fallensparks
George's Marvellous Medicine(thing)
Ctrl Y
cognitive dissonance(fiction)
SharQ
Gone Baby Gone(review)
halfWit
If I could, I'd title this "Freedom"(thing)
Roninspoon
Airline Hero(thing)
Ktistec
Why Women Are Always Cold(person)
doctor wilson
Drug policy reform(thing)
tejasa
Easy Raspberry Cheesecake(recipe)
Joysim
Drug policy reform(idea)
aneurin
Tyburn(place)
niruena
Boiling to death(idea)
artman2003
summer(thing)
doctor wilson
The Silver City and the Silent Sea(log)
Dreamvirus
The Silver City and the Silent Sea(poetry)
Aerobe
A nihilist's soulmate(poetry)
This page courtesy of The Everything Development Company