function elliptic_em_test ( )

%*****************************************************************************80
%
%% elliptic_em_test() tests elliptic_em().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    31 May 2018
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'elliptic_em_test():\n' );
  fprintf ( 1, '  elliptic_em() returns values of\n' );
  fprintf ( 1, '  the complete elliptic integral of the\n' );
  fprintf ( 1, '  second kind, with parameter M.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '      M       E(M)          E(M)\n' );
  fprintf ( 1, '          Tabulated         Calculated\n' );
  fprintf ( 1, '\n' );

  n_data = 0;

  while ( true )

    [ n_data, m, fx ] = elliptic_em_values ( n_data );

    if ( n_data == 0 )
      break
    end

    fx2 = elliptic_em ( m );

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

  end

  return
end
