x=linspace(0.996,1.004,81);
p1=(x-1).^6;
p2=x.^6-6*x.^5+15*x.^4-20*x.^3+15*x.^2-6*x+1;
a=[1, -6,15,-20,15,-6,1];
p3 = horner2(a,x);
plot(x,p1,x,p2,x,p3);
legend('p1','p2','p3');