function f = p04_f ( x )

%*****************************************************************************80
%
%% p04_f() evaluates the objective function for test 4.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    23 February 2026
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real x: the argument.
%
%  Output:
%
%    real f: the function value.
%
  f = 3.0 + max ( 4.0 * cos ( x ), -3.0 );

  return
end

