function jacobi_cn_test ( )

%*****************************************************************************80
%
%% jacobi_cn_test() tests jacobi_cn().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    15 July 2024
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'jacobi_cn_test():\n' );
  fprintf ( 1, '  jacobi_cn() evaluates the Jacobi elliptic function CN.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '    U       M       Exact CN                CN(U,M)\n' );
  fprintf ( 1, '\n' );

  n_data = 0;

  while ( true )

    [ n_data, u, a, k, m, cn1 ] = jacobi_cn_values ( n_data );

    if ( n_data == 0 )
      break;
    end

    cn2 = jacobi_cn ( u, m );

    fprintf ( 1, '%8.4f%8.4f%24.16g%24.16g\n', u, m, cn1, cn2 );

  end

  return
end
