function [ xn, xp ] = bisection1 ( f, xn, xp )

%*****************************************************************************80
%
%% bisection1 carries out the bisection method for 10 steps.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    10 September 2019
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    function handle F: a pointer to a function.  This can be
%    an anonymous function or the name of a MATLAB M-file function.
%
%    real xn, xp: f(xn) is negative, f(xp) is positive.
%
%  Output:
%
%    real xn, xp: f(xn) is negative, f(xp) is positive, and
%    the estimated root is the midpoint of this interval.
%
  for it = 1 : 10

    x = ( xn + xp ) / 2.0;

    if ( f ( x ) < 0.0 )
      xn = x;
    else
      xp = x;
    end

  end

  return
end
