function value = box_f ( x, n )

%*****************************************************************************80
%
%% box_f() evaluates the Box function.
%
%  Discussion:
%
%    The function is formed by the sum of squares of 10 separate terms.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    30 July 2016
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real X(N), the evaluation point.
%
%    integer N, the number of variables.
%
%  Output:
%
%    real VALUE, the function value.
%
  value = 0.0;

  for i = 1 : 10

    c = - i / 10.0;

    fx = exp ( c * x(1) ) - exp ( c * x(2) ) ...
      - x(3) * ( exp ( c ) - exp ( 10.0 * c ) );

    value = value + fx ^ 2;

  end

  return
end
