% Snippet p. 160

m = 2*floor(log2(n))+4; u = eps/2; gamma = m*u/(1-m*u);
r = b-A*x;
err = (norm(r)+gamma*norm(A*abs(x)+abs(b)))/x(1);