function x = parabola_critical ( f, a, b, c )

%*****************************************************************************80
%
%% parabola_critical finds the critical point of a parabola.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    25 September 2019
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    function handle f: the function for which a minimizer
%    is sought.
%
%    real a, b, c: three x values.  The parabola is defined by the
%    interpolant to (a,f(a)), (b,f(b)), (c,f(c)).
%
%  Output:
%
%    real x: the critical point of the parabola.
%
  top = ( b - a ) * ( b + a ) * ( f(b) - f(c) ) ...
      - ( b - c ) * ( b + c ) * ( f(b) - f(a) );

  bot = ( b - a ) * ( f(b) - f(c) ) ...
      - ( b - c ) * ( f(b) - f(a) );

  x = 0.5 * top / bot;

  return
end

