function jacobi_dnk_test ( )

%*****************************************************************************80
%
%% jacobi_dnk_test() tests jacobi_dnk().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    19 November 2020
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'jacobi_dnk_test():\n' );
  fprintf ( 1, '  jacobi_dnk(u,k) returns values of\n' );
  fprintf ( 1, '  the Jacobi elliptic DN function.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '        U           K              ' );
  fprintf ( 1, '     DN(U,K)                 DN(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_dn_values ( n_data );

    if ( n_data == 0 )
      break
    end

    fx1 = jacobi_dnk ( u, k );

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

  end

  return
end
