function runge_fun_test ( )

%*****************************************************************************80
%
%% runge_fun_test() tests runge_fun().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    24 March 2025
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'runge_fun_test():\n' );
  fprintf ( 1, '  runge_fun() evaluates the runge function.\n' );

  a = -1.0;
  b = +1.0;
  x = linspace ( a, b, 101 );
  y = runge_fun ( x );

  clf ( );

  hold ( 'on' )

    plot ( x, y, 'b-', 'Linewidth', 2 );

    plot ( [a,b], [0,0], 'k-', 'linewidth', 2 );

    ymin = min ( y );
    ymax = max ( y );
    if ( ymin <= 0.0 && 0.0 <= ymax )
      plot ( [0, 0], [ymin,ymax], 'k-', 'linewidth', 2 );
    end

  hold ( 'off' );

  grid ( 'on' );
  xlabel ( '<--- X --->' );
  ylabel ( '<--- Y --->' );
  title ( 'y = runge(x)' );
  filename = 'runge_fun.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'runge_fun_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end

