xtol = 0.000001;
a = 0.5;
b = 1.5;
[ x1, a, b ] = bisection3 ( xtol, a, b, @f123 );
fprintf ( 'F(%20.16g) = %g\n', x1, f123 ( x1 ) );

xtol = 0.000001;
a = 1.5;
b = 2.5;
[ x2, a, b ] = bisection3 ( xtol, a, b, @f123 );
fprintf ( 'F(%20.16g) = %g\n', x2, f123 ( x2 ) );

xtol = 0.000001;
a = 2.5;
b = 3.5;
[ x3, a, b ] = bisection3 ( xtol, a, b, @f123 );
fprintf ( 'F(%20.16g) = %g\n', x3, f123 ( x3 ) );

xlist = linspace ( 0, 4, 201 );
ylist = f123 ( xlist );
plot ( xlist, ylist, ...
       xlist, 0*ylist, 'k:', ...
       x1, 0, 'r.', ...
       x2, 0, 'r.', ...
       x3, 0, 'r.', ...
       'LineWidth', 3, 'Markersize', 50 )
grid on
xlabel ( '<-- X -->' )
ylabel ( '<-- Y -->' )
title ( 'y=(x-1)*(x-2)*(x-3)', 'Fontsize', 24 )
print ( '-djpeg', 'f123_roots.jpg' )