function jacobi_snk_test ( )

%*****************************************************************************80
%
%% jacobi_snk_test() tests jacobi_snk().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    19 November 2020
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'jacobi_snk_test():\n' );
  fprintf ( 1, '  jacobi_snk(u,k) returns values of\n' );
  fprintf ( 1, '  the Jacobi elliptic SN function.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '        U           K              ' );
  fprintf ( 1, '     SN(U,K)                 SN(U,K)             |Diff|\n' );
  fprintf ( 1, '                                   ' );
  fprintf ( 1, '     Computed               Tabulated\n' );
  fprintf ( 1, '\n' );

  n_data = 0;

  while ( true )

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

    if ( n_data == 0 )
      break
    end

    fx1 = jacobi_snk ( u, k );

    fprintf ( 1, '  %12f  %12f  %24.16f  %24.16f  %8.2g\n', u, k, fx1, fx2, abs ( fx1 - fx2 ) );

  end

  return
end
