function elliptic_inc_pik_test ( )

%*****************************************************************************80
%
%% elliptic_inc_pik_test() tests elliptic_inc_pik().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    22 June 2018
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'ELLIPTIC_INC_PIK_TEST():\n' );
  fprintf ( 1, '  ELLIPTIC_INC_PIK returns values of\n' );
  fprintf ( 1, '  the incomplete elliptic integral of the\n' );
  fprintf ( 1, '  third kind, with parameters PHI, N, K.\n' );
  fprintf ( 1, '  Compare with MATLAB ellipticPi(n,phi,k^2)\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '          Phi             N               K                ')
  fprintf ( 1, 'ellipticPi(n,phi,k^2)  elliptic_inc_pik(phi,n,k)\n' );
  fprintf ( 1, '\n' );

  for i = 1 : 20

    phi = 0.5 * pi * rand ( 1, 1 );
    nbound = ( 1.0 / sin ( phi ) ) ^ 2;
    n = - nbound + 2.0 * nbound * rand ( 1, 1 );
    kbound = abs ( 1.0 / sin ( phi ) );
    k = - kbound + 2.0 * kbound * rand ( 1, 1 );
    fx1 = ellipticPi ( n, phi, k^2 );
    fx2 = elliptic_inc_pik ( phi, n, k );

    fprintf ( 1, '  %14.6f  %14.6f  %14.6f  %24.16g  %24.16g\n', phi, n, k, fx1, fx2 );

  end

  return
end
