function runge_power_series_test ( )

%*****************************************************************************80
%
%% runge_power_series_test() tests runge_power_series().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    24 March 2025
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'runge_power_series_test():\n' );
  fprintf ( 1, '  runge_power_series() evaluates a power series\n' );
  fprintf ( 1, '  for the runge function, valid in (-0.2, +0.2).\n' );

  a = -0.2;
  b = +0.2;
  x = linspace ( a, b, 101 );
  y1 = runge_fun ( x );
  y2 = runge_power_series ( x, 8 );

  clf ( );

  hold ( 'on' )

    plot ( x, y1, 'b-', 'Linewidth', 2 );
    plot ( x, y2, 'ro' );

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

    ymin = min ( y1 );
    ymax = max ( y1 );
    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 ( 'runge(x) versus power series' );
  filename = 'runge_power_series.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'runge_power_series_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end

