fprintf ( 1, '\n' );
fprintf ( 1, 'poly2_newton_system2:\n' );
fprintf ( 1, '  Use Newton''s method for a root of the poly2 function.\n' );

global print_f_norm
global print_r
global print_x

print_f_norm = false;
print_r = true;
print_x = false;

x = [ 1.0; -1.0 ];
xtol = 0.0000001;
ftol = 0.0000001;
itmax = 50;

[ x, it ] = newton_system2 ( @(x)poly2(x), @(x)poly2_fp(x), x, xtol, ftol, itmax );

fprintf ( 1, '\n' );
fprintf ( 1, '  Number of steps = %d\n', it );
fprintf ( 1, '  x = (%20.16g, %20.16g)\n', x );
fprintf ( 1, '  f(x) = (%g, %g)\n', poly2(x) );

