factor = 0.02;
x = - 3.0 + 6.0 * rand ( 2, 1);
i = 0;

while ( true )
  fx = f2(x);
  fpx = fp2(x);
  fprintf ( 1, '  %d  (%g,%g)  %g  %g\n', i, x(1), x(2), fx, norm ( fpx ) );
  if ( norm ( fpx ) < 0.001 )
    break
  end
  pause

  i = i + 1;
  x = x - factor * fpx;
end

