function lambert_w_test01 ( )

%*****************************************************************************80
%
%% lambert_w_test01() compares lambert_w() to stored values, and a build in function.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    19 June 2023
%
%  Author:
%
%    John Burkardt.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'lambert_w_test01():\n' );
  fprintf ( 1, '  Compare stored, computed, and system values for LambertW(x).\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '      X           Stored value       lambert_w(x)       lambertw(x)\n' );
  fprintf ( 1, '\n' );

  n_data = 0;

  while ( true )

    [ n_data, x, fx1, branch ] = lambert_w_values ( n_data );

    if ( n_data == 0 )
      break
    end

    fx2 = lambert_w ( x, branch, 0 );

    fx3 = lambertw ( branch, x );

    fprintf ( 1, '  %12.6g  %25.16f  %25.16f  %25.16f\n', x, fx1, fx2, fx3 );

  end

  return
end
