fprintf ( '\n' );
fprintf ( 'hump_secant2\n' );
fprintf ( '  Use the secant method to search for a root of the hump function.\n' );

a = 1.0;
b = 2.0;

xtol = 0.000001;
ftol = 0.000001;
itmax = 50;

fprintf ( '\n' );
fprintf ( '  F(%g) = %g\n', a, hump(a) );
fprintf ( '  F(%g) = %g\n', b, hump(b) );

[ a, b, it ] = secant2 ( @(x)hump(x), a, b, xtol, ftol, itmax );

fprintf ( '\n' )
fprintf ( '  After %d iterations:\n', it );
fprintf ( '  F(%g) = %g\n', b, hump(b) );
fprintf ( '\n' );
fprintf ( '  it <= itmax?  %s\n', mat2str ( it <= itmax ) );
fprintf ( '  |a-b| <= xtol?  %s\n', mat2str ( abs ( a - b ) <= xtol ) );
fprintf ( '  |f(b)| <= ftol?  %s\n', mat2str ( abs (hump(b)) <= ftol ) );

