Wilkinson' s polynomial

Definition

P (x)=(∏_(m = 1)^n)(x - m)

Factored form

p20[x_] = Product[(x - i), {i, 20}]

Expanded form

w20[x_] = Expand[Product[(x - i), {i, 20}]]

Obviously p20[x]  =  w20[x].

Horner form

Later we will compare the above forms with the Horner form.

<< Algebra`Horner`

h20[x_] = Horner[w20[x], x]

Checking the roots

Integer roots

The roots are also integer:

r20i = Table[{x -> i}, {i, 20}]

Applying the rules to the factored form

p20[x] /. r20i

and to the expanded form

w20[x] /. r20i

we got the same results.

Floating  point roots

Define similar rules in the real (floating point) representation.

r20 = Table[{x -> i}, {i, 1. , 20. , 1. }]

Applying these rules to p20[x] and w20[x] 
      gives quite different results:

p20[x] /. r20

w20[x] /. r20

This is the effect of round - off errors.

Horner form:

h20[x] /. r20

Numerical root finding

The rules r20 or r20i represent the exact roots of the Wilkinson' s polynomial .  Below are the results of the built - 
      in NSolve function.

r = NSolve[w20[x], x]

Or in the list form:

x /. r

With higher accuracy

NumberForm[%, {20, 17}]

The rules r applied to w20[x] give

w20[x] /. r

- still not zeroes.

Try the Horner form

rh = NSolve[h20[x], x]

Sensitivity experiments

The roots of polynomials continuously depend on their coefficients .  
          Suppose that rhe coefficient of (x^19) is modified :  -210  ->  -210  -  
        (2^(-19)) .  
            This is a relatively small (~(10^(-8))) change.

pm[x_] = w20[x] - 2^(-23) x^19

The solution is

rm = NSolve[pm[x], x]

x /. rm

Substitut the roots back to the modified polinomial

pm[x] /. rm

Plot[p[x],  {x, 0.9, 20.9}]

q[x_] = Sign[x] Log[1 + Abs[x]]

Plot[q[w20[x]], {x, 0.9, 20.1}]

Plot[q[p[x]], {x, 0.9, 21}]