function f = p10_f ( m, n, x )

%*****************************************************************************80
%
%% p10_f evaluates the objective function for problem 10.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    19 January 2021
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Marcin Molga, Czeslaw Smutnicki,
%    Test functions for optimization needs.
%
%  Input:
%
%    integer M, the spatial dimension.
%
%    integer N, the number of arguments.
%
%    real X(M,N), the arguments.
%
%  Output:
%
%    real F(N), the function evaluated at the arguments.
%
  f = zeros ( n, 1 );

  p = 10;

  y = ( 1 : m )';

  for j = 1 : n
    f(j) = - sum ( ...
      sin ( x(1:m,j) ) .* ( sin ( x(1:m,j).^2 .* y / pi ) ).^( 2 * p ) ...
    );
  end

  return
end
