function res = squarerootV2(x) % Version 2
if x > 1
   %!! Set up the interval
   lower = 1;
   upper = x;
else
   lower = x;
   upper = 1;
end

for k=1:20
   %!! Loop 20 times
   middle = (lower+upper)./2; %! \linelabel{startblock}
   %!! First line in the loop
   if middle.*middle > x
      upper = middle;
   else
      lower = middle;
   end %! \linelabel{endblock}
   %!! Last line in the loop.
end

res = (upper + lower)./2;
%!! The output.