start=2;
stop=40;
z2=[1:stop];
z2(2)=2;
err2=[1:stop];

function out = iter2(z,n)
	out=sqrt(2)*z/sqrt(1+sqrt(1- (4^(1-n)) * (z^2) ));
end

for n=start:stop-1
	z2(n+1)=iter2(z2(n),n);
endfor

ideal=ones(1,stop).*pi;
err2=abs(ideal.-z2);
n=1:stop;
gset term postscript
gset output "p6_fig2.ps"
semilogy(n(start:stop),err2(start:stop))
gset term x11

z1
err1
z2
err2
