Re: Math Help!! Message #9 Posted by Les Wright on 16 Apr 2012, 8:40 p.m., in response to message #1 by Namir
Namir, here is a simple 10th-degree example without odd-powered terms to demonstrate the method Smith uses:
1 + 3x^2 +4x^4 + 5x^6 + 2x^8 + 7x^10 = 1 + x^2(3 + x^2(4 + x^2(5 + x^2(2 + 7x^2))))
If C is a 0-based 5 element vector containing the coefficients in the order written, a C-code snippet might look like this:
C=[1,3,4,5,2,7];
y=x*x;
p=C[n-1];
for(j=n-2;j>=0;j--) p=p*y+c[j];
FWIW, it seems that Smith never uses the term "Horner's Method", but he does discuss the process of rewriting polynomials in this nested form on pages 31-32ff.
HTH,
Les
Edited: 16 Apr 2012, 9:01 p.m.
|