function laplacian3_interval_test ( )

%*****************************************************************************80
%
%% laplacian3_interval_test() tests laplacian3_interval().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    23 September 2024
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'laplacian3_interval_test():\n' );
  fprintf ( 1, '  laplacian3_interval() approximates the Laplacian operator\n' );
  fprintf ( 1, '  applied to a function on an interval.\n' );
  fprintf ( 1, '\n' );

  for p = [ 1, 2, 4 ]

    nx = 5 * p;
    xmin = 0.0;
    xmax = 2.0 * pi;
    x = linspace ( xmin, xmax, nx );
    dx = ( xmax - xmin ) / ( nx - 1 );

    A = sin ( x );
%
%  A2 is the exact value of the Laplacian.
%
    A2 = - sin ( x );
%
%  L is our estimate.
%
    L = laplacian3_interval ( A, dx );
%
%  Ignore error at first and last nodes.
%
    e = rms_norm ( L(2:nx-1) - A2(2:nx-1) );
    fprintf ( 1, '  DX = %g, RMS error = %g\n', dx, e );

  end

  return
end

