function interp_test04 ( data_num )

%*****************************************************************************80
%
%% INTERP_TEST04 tests INTERP_LAGRANGE on 1-dimensional data, Clenshaw-Curtis data.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    03 July 2012
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer DATA_NUM, the number of data values.
%
  m = 1;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'INTERP_TEST04\n' );
  fprintf ( 1, '  INTERP_LAGRANGE evaluates a polynomial interpolant.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  In this example, the function we are interpolating is\n' );
  fprintf ( 1, '  Runge''s function, with Clenshaw Curtis knots.\n' );

  t_min = -1.0;
  t_max = +1.0;

  t_data = cc_abscissas_ab ( t_min, t_max, data_num );
  t_data = reshape ( t_data, 1, data_num );

  p_data = f_runge ( m, data_num, t_data );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  The data to be interpolated:\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Spatial dimension =     %d\n', m );
  fprintf ( 1, '  Number of data values = %d\n', data_num );
  fprintf ( 1, '\n' );
  fprintf ( 1, '       T_data        P_data\n' );
  fprintf ( 1, '\n' );
  for i = 1 : data_num
    fprintf ( 1, '  %14.6g  %14.6g\n', t_data(1,i), p_data(1,i) );
  end
%
%  Our interpolation values will include the original T values, plus
%  3 new values in between each pair of original values.
%
  before = 4;
  fat = 3;
  after = 2;

  interp_num = before + 1 + ( data_num - 1 ) * ( fat + 1 ) + after;

  t_interp = r8vec_expand_linear2 ( data_num, t_data, before, fat, after );
  t_interp = reshape ( t_interp, 1, interp_num );

  p_interp = interp_lagrange ( m, data_num, t_data, p_data, interp_num, t_interp );
  p_interp = reshape ( p_interp, 1, interp_num );

  p_value = f_runge ( m, interp_num, t_interp );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Interpolation:\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '    T_interp      P_interp        P_exact        Error\n' );
  fprintf ( 1, '\n' );

  for interp = 1 : interp_num

    fprintf ( 1, '  %10.4f  %14.6g  %14.6g  %10.2g\n', ...
      t_interp(1,interp), p_interp(1,interp), p_value(1,interp), ...
      p_interp(1,interp) - p_value(1,interp) );

  end

  return
end
