function elliptic_inc_fm_test ( )

%*****************************************************************************80
%
%% elliptic_inc_fm_test() tests elliptic_inc_fm().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    21 June 2018
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'elliptic_inc_fm_test():\n' );
  fprintf ( 1, '  elliptic_inc_fm() returns values of\n' );
  fprintf ( 1, '  the incomplete elliptic integral of the\n' );
  fprintf ( 1, '  first kind, with parameters PHI, M.\n' );
  fprintf ( 1, '  Compare with MATLAB ellipticF(phi,m)\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '          Phi             K                ellipticF(phi,m)    elliptic_inc_fm(phi,m)\n' );
  fprintf ( 1, '\n' );

  for i = 1 : 20

    phi = 0.5 * pi * rand ( 1, 1 );
    mbound = 1.0 / ( sin ( phi ) ) ^ 2;
    m = mbound * rand ( 1, 1 );
    fx1 = ellipticF ( phi, m );
    fx2 = elliptic_inc_fm ( phi, m );

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

  end

  return
end
