function f = p08_f ( m, n, x )

%*****************************************************************************80
%
%% p08_f() evaluates the M nonlinear functions for problem 8.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    03 March 2026
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Jorge More, Burton Garbow, and Kenneth Hillstrom,
%    Testing unconstrained optimization software,
%    ACM Transactions on Mathematical Software,
%    Volume 7, pages 17-41, 1981.
%
%  Input:
%
%    integer M, the number of functions.
%
%    integer N, the number of unknowns.
%
%    real X(N), the evaluation point.
%
%  Output:
%
%    real F(M), the value of the functions evaluated at X.
%
  f = zeros ( m, 1 );

  y = [ ...
    0.14; 0.18; 0.22; 0.25; 0.29; ...
    0.32; 0.35; 0.39; 0.37; 0.58; ...
    0.73; 0.96; 1.34; 2.10; 4.39 ];

  for i = 1 : 15
    tmp1 = i;
    tmp2 = 16 - i;
    if ( i <= 8 )
      tmp3 = tmp1;
    else
      tmp3 = tmp2;
    end
    f(i) = y(i) - x(1) - tmp1 / ( x(2) * tmp2 + x(3) * tmp3 );
  end

  return
end

