function besselj1squared_test ( )

%*****************************************************************************80
%
%% BESSELJ1SQUARED_TEST tests BESSELJ1SQUARED.
%
%  Discussion:
%
%    MATLAB provides the built in BESSELJ(NU,Z) function.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    06 January 2016
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Ignace Bogaert,
%    Iteration-free computation of Gauss-Legendre quadrature nodes and weights,
%    SIAM Journal on Scientific Computing,
%    Volume 36, Number 3, 2014, pages A1008-1026.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'BESSELJ1SQUARED_TEST:\n' );
  fprintf ( 1, '  BESSELJ1SQUARED returns the square of the Bessel J1(X) function\n' );
  fprintf ( 1, '  at the K-th zero of J0(X).\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '   K           X(K)                    J1(X(K))^2                 BESSELJ1SQUARED\n' );
  fprintf ( 1, '\n' );

  for k = 1 : 30
    x = besseljzero ( k );
    f1 = besselj ( 1, x ) ^ 2;
    f2 = besselj1squared ( k );
    fprintf ( 1, '  %2d  %24.16g  %24.16g  %24.16g\n', k, x, f1, f2 );
  end

  return
end

