fprintf ( '\n' );
fprintf ( 'hump_regula_falsi2\n' );
fprintf ( '  Use modified regula_falsi to estimate a root of a hump function.\n' );

xn = 10.0;
xp = 0.0;
xtol = 0.000001;
ftol = 0.000001;
itmax = 50;

fprintf ( '\n' );
fprintf ( '  F(%g) = %g (negative)\n', xn, hump(xn) );
fprintf ( '  F(%g) = %g (positive)\n', xp, hump(xp) );

[ xn, xp, it ] = regula_falsi2 ( @(x)hump(x), xn, xp, xtol, ftol, itmax );

fprintf ( '\n' )
fprintf ( '  After %d iterations:\n', it );
fprintf ( '  F(%20.16g) = %g (negative)\n', xn, hump(xn) );
fprintf ( '  F(%20.16g) = %g (positive)\n', xp, hump(xp) );
fprintf ( '\n' );
fprintf ( '  it <= itmax?  %s\n', mat2str ( it <= itmax ) );
fprintf ( '  |xn-xp| <= xtol?  %s\n', mat2str ( abs ( xn - xp ) <= xtol ) );
fprintf ( '  min(|f(xn)|,|f(xp)|) <= ftol?  %s\n', mat2str ( min(abs (hump(xn)),abs(hump(xp))) <= ftol ) );

