function jacobi_snm_test ( )

%*****************************************************************************80
%
%% jacobi_snm_test() tests jacobi_snm().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    19 November 2020
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'jacobi_snm_test():\n' );
  fprintf ( 1, '  jacobi_snm evaluates the Jacobi elliptic function SN(U,M).\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '    U       M       Exact SN                SN(U,M)     |Diff|\n' );
  fprintf ( 1, '\n' );

  n_data = 0;

  while ( true )

    [ n_data, u, a, k, m, sn1 ] = jacobi_sn_values ( n_data );

    if ( n_data == 0 )
      break;
    end

    sn2 = jacobi_snm ( u, m );

    fprintf ( 1, '%8.4f%8.4f%24.16g%24.16g  %8.2g\n', u, m, sn1, sn2, abs ( sn1 - sn2 ) );

  end

  return
end
