% Experiments with Wilkinson's polynomial
% Starting recursion
p=[1 -1]
% 20-th order polynomial
for n=2:20, p=[p 0]-[0 p*n];end
format long
% all roots
r = roots(p)
% prepare to plot 
x=0.9:0.1:20.1;
% lin-log scale
y=polyval(p,x);
z=sign(y).*log10(1+abs(y));
plot(x,z)
xlabel('x')
ylabel('sign(p(x))*log10(1+abs(p(x))')
axis([0 21 -20  20])
% add zero
hold on
plot([0.5 20.5],[0 0])
pause
% modify the coefficient at x**19
p(2)=p(2)-2^(-23);
% now check the roots
r = roots(p)
% plot the modified polynomial
xx=0.8:0.1:21;
y = polyval(p,xx);
z = sign(y).*log10(1+abs(y));
plot(xx,z)
xlabel('x')
ylabel('sign(p(x))*log10(1+abs(p(x))')
axis([0 22 -20  20])
hold on
plot([0.5 21.5],[0 0])
