function jacobi_cn_test ( )

%*******************************************************************************
%
%% JACOBI_CN_TEST tests JACOBI_CN.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    25 June 2018
%
%  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, 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