fprintf ( '\n' );
fprintf ( 'kepler_regula_falsi3\n' );
fprintf ( '  Use modified regula_falsi to estimate a root of a kepler 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, kepler(xn) );
fprintf ( '  F(%g) = %g (positive)\n', xp, kepler(xp) );

[ xn, xp, it ] = regula_falsi3 ( @(x)kepler(x), xn, xp, xtol, ftol, itmax );

fprintf ( '\n' )
fprintf ( '  After %d iterations:\n', it );
fprintf ( '  F(%20.16g) = %g (negative)\n', xn, kepler(xn) );
fprintf ( '  F(%20.16g) = %g (positive)\n', xp, kepler(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 (kepler(xn)),abs(kepler(xp))) <= ftol ) );

