function square_symq_rule_test01 ( p )

%*****************************************************************************80
%
%% square_symq_rule_test01() prints a rule of precision P.
%
%  Licensing:
%
%    This code is distributed under the GNU GPL license.
%
%  Modified:
%
%    16 July 2023
%
%  Author:
%
%    Original FORTRAN77 version by Hong Xiao, Zydrunas Gimbutas.
%    This version by John Burkardt.
%
%  Reference:
%
%    Hong Xiao, Zydrunas Gimbutas,
%    A numerical algorithm for the construction of efficient quadrature
%    rules in two and higher dimensions,
%    Computers and Mathematics with Applications,
%    Volume 59, 2010, pages 663-676.
%
%  Input:
%
%    integer p: the precision of the rule.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'square_symq_rule_test01():\n' );
  fprintf ( 1, '  Symmetric quadrature rule for a square.\n' );
  fprintf ( 1, '  Precision = %d\n', p );
%
%  Retrieve and print a symmetric quadrature rule.
%
  n = rule_order ( p );
  [ x, y, w ] = square_symq ( p, n );

  fprintf ( 1, '\n' );
  fprintf ( 1, '     J  W       X       Y\n' );
  fprintf ( 1, '\n' );
  for j = 1 : n
    fprintf ( 1, '  %4d  %14.6g  %14.6g  %14.6g\n', j, w(j), x(j), y(j) );
  end

  w_sum = sum ( w(1:n) );

  fprintf ( 1, '  Weight sum  %14.6g\n', w_sum );

  return
end
