fprintf ( '\n' );
fprintf ( 'wiggle_regula_falsi\n' );
fprintf ( '  Use regula_falsi to estimate a root of the wiggle equation.\n' );

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

fprintf ( '\n' );
fprintf ( '  F(%g) = %g\n', xn, wiggle(xn) );
fprintf ( '  F(%g) = %g\n', xp, wiggle(xp) );

[ xn, xp, it ] = regula_falsi ( @(x)wiggle(x), xn, xp, xtol, ftol, itmax );

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

