function value = smith2_f ( m, n, x )

%*****************************************************************************80
%
%% SMITH2_F returns the function in the smith2 problem.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    21 January 2016
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Andrew Smith,
%    Fast construction of constant bound functions for sparse polynomials,
%    Journal of Global Optimization,
%    Volume 43, 2009, pages 445-458.
%
%  Parameters:
%
%    Input, integer M, the number of variables.
%
%    Input, integer N, the number of points.
%
%    Input, real X(M,N), the points.
%
%    Output, real VALUE(N), the value of the function at X.
%
  value(1:n) = ( ...
       3.0E+00  * x(1,1:n)     .* x(2,1:n) .^5                 ...
    +  2.0E+00  * x(1,1:n) .^4 .* x(2,1:n)                     ...
    -  8.0E+00  * x(1,1:n) .^2 .* x(3,1:n) .^6 .* x(4,1:n) .^2 ...
    -             x(1,1:n)     .* x(4,1:n) .^8                 ...
    +  3.0E+00  * x(2,1:n) .^3 .* x(5,1:n)                     ...
    - 10.0E+00  * x(4,1:n) .^5 .* x(5,1:n) .^5 .* x(6,1:n) .^5 ...
    -  0.01E+00 * x(5,1:n) .^2 .* x(6,1:n) .^2                 ...
    +  4.0E+00  * x(5,1:n) .^3 .* x(7,1:n) .^4 )';
 
  return
end


