function diffjac_test ( )

%*****************************************************************************80
%
%% diffjac_test() tests diffjac().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    13 April 2021
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'diffjac_test()\n' );
  fprintf ( 1, '  diffjac() uses finite differences to estimate\n' );
  fprintf ( 1,'   the jacobian J(X) of a function F(X).\n' );
  
  fprintf ( 1, '\n' );
  fprintf ( 1, '  The evaluation point X:\n' );
  x = [ 1.0; 2.0; 3.0 ]

  fprintf ( 1, '\n' );
  fprintf ( 1, '  The function value F(X):\n' );
  fx = helical_valley_fx ( x )

  fprintf ( 1, '\n' );
  fprintf ( 1, '  The exact jacobian J(X):\n' );
  jac = helical_valley_jacobian ( x )

  fprintf ( 1, '\n' );
  fprintf ( 1, '  The estimated jacobian J2(X):\n' );
  [ l, u ] = diffjac ( x, @helical_valley_fx, fx );

  jac2 = l * u
  
  return
end

