function pi_estimate_test ( )

%*****************************************************************************80
%
%% pi_estimate_test() tests pi_estimate().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    28 May 2022
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'pi_estimate_test():\n' );
  fprintf ( 1, '  pi_estimate() estimates Pi(n), the number of primes\n' );
  fprintf ( 1, '  less than or equal to n.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '       N                Pi(n)                   Pi(n)                  Ratio\n' );
  fprintf ( 1, '                        estimated               tabulated\n' );
  fprintf ( 1, '\n' );

  n_data = 0;

  while ( true )

    [ n_data, n, pi2 ] = pi_values ( n_data );

    if ( n_data == 0 )
      break
    end

    pi1 = pi_estimate ( n );

    r = pi1 / pi2;

    fprintf ( 1, '  %10d  %20.1f  %10d  %8.4f\n', n, pi1, pi2, r );

  end

  return
end
