function [ xmin, pmin ] = paramin ( xdata, ydata )

%*****************************************************************************80
%
%% PARAMIN finds the minimizer of the parabolic interpolant to data.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    16 July 2011
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, real XDATA(3), three X values.
%
%    Input, real YDATA(3), the value of F(X) at the X values.
%
%    Output, real XMIN, PMIN, the location of the minimizer of the
%    parabolic interpolant, and the value of the parabolic interpolant there.
%
%    Output, real PVAL, the value of the parabolic interpolant at XVAL.
%
  xmin = xdata(2) - 0.5 * ( ...
      ( xdata(2) - xdata(1) )^2 * ( ydata(2) - ydata(3) ) ...
    - ( xdata(2) - xdata(3) )^2 * ( ydata(2) - ydata(1) ) ) / ( ...
      ( xdata(2) - xdata(1) )   * ( ydata(2) - ydata(3) ) ...
    - ( xdata(2) - xdata(3) )   * ( ydata(2) - ydata(1) ) );

  pmin = paraval ( xdata, ydata, xmin );

  return
end

