Horner's Rule

Author

Eric W. Weisstein
April 14, 2004

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Algebra/HornersRule.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/HornersRule.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Code

PolynomialFromCoefs[l_List,x_]:=Fold[x#1+#2&,0,l]

Examples

a=PolynomialFromCoefs[Range[10],x]

Timing[Table[a/.x->12.43,{10^5}];]

FullForm[a/.x->12.43]

b=Expand[a]

Timing[Table[b/.x->12.43,{10^5}];]

FullForm[b/.x->12.43]