xtol = 0.000001;
a = 0.0;
b = 3.0;
[ x, a, b ] = bisection3 ( xtol, a, b, @wallis );
fprintf ( '\n' );
fprintf ( 'Solution: F(%20.16g) = %g\n', x, wallis ( x ) );
fprintf ( 'Interval: [%20.16g, %20.16g]\n', a, b );
fprintf ( 'Interval width: %g\n', b - a );

xlist = linspace ( 0.0, 3.0, 101 );
ylist = wallis ( xlist );

plot ( xlist, ylist, ...
       xlist, 0*ylist, 'k:', ...
       x, 0, 'r.', ...
       'Linewidth', 3, 'Markersize', 50 );
grid on
xlabel ( '<-- X -->' )
ylabel ( '<-- Y -->' )
title ( 'Estimated zeros of wallis', 'Fontsize', 24 );

print ( '-djpeg', 'hw041.jpg' );
