BRUTE_POLY(A,x)
- value ← 0
- for i ← n down to 0 do
- value ← value + A[i] * xi
- return value
P = anxn+an-1xn-1 + ... + a1x1+a0x0 = (anx+an-1)xn-1 + ... + a1x1+a0x0 = ((anx+an-1)x+ an-2)xn-2 + ... + a1x1+a0x0 = [anx+an-1)x+ an-2)x + ... + a1)x + a0 7x4+9x3+5x2+8x+4 = (((7x+ 4)x+5)x+ 8)x+4
HORNER(A,n)
- value ← A[n]
- for i ← n-1 down to 0 do
- value ← value*x + A[i]
- return value