function value = butcher_f ( m, n, x )

%*****************************************************************************80
%
%% butcher_f() returns the function in the butcher problem.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    20 January 2016
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Cesar Munoz, Anthony Narkawicz,
%    Formalization of Bernstein polynomials and applications to global 
%    optimization,
%    Journal of Automated Reasoning,
%    Volume 51, Number 2, 2013, pages 151-196.
%
%  Input:
%
%    integer M, the number of variables.
%
%    integer N, the number of points.
%
%    real X(M,N), the points.
%
%  Output:
%
%    real VALUE(N), the value of the function at X.
%
  value(1:n) = ( ...
      x(6,1:n) .* x(2,1:n) .^2 ...
    + x(5,1:n) .* x(3,1:n) .^2 ...
    - x(1,1:n) .* x(4,1:n) .^2 ...
    + x(4,1:n) .^3 ...
    + x(4,1:n) .^2 ...
    - 1.0E+00 / 3.0E+00 * x(1,1:n) ...
    + 4.0E+00 / 3.0E+00 * x(4,1:n)  )';
 
  return
end


