function r8_hypot_test ( )

%*****************************************************************************80
%
%% R8_HYPOT_TEST tests R8_HYPOT.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    31 July 2018
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'R8_HYPOT_TEST\n' );
  fprintf ( 1, '  R8_HYPOT computes sqrt(A^2+B^2) carefully.\n' ); 
  fprintf ( 1, '\n' );
  fprintf ( 1, '       A             B              R8_HYPOT      Norm     sqrt(A^2+B^2)\n' );
  fprintf ( 1, '\n' );

  r8_lo = - r8_huge ( ) / 2.0;
  r8_hi = + r8_huge ( ) / 2.0;
  seed = 123456789;

  for test = 1 : 5

    [ r1, seed ] = r8_uniform_ab ( r8_lo, r8_hi, seed );
    [ r2, seed ] = r8_uniform_ab ( r8_lo, r8_hi, seed );
    r3 = r8_hypot ( r1, r2 );
    r4 = norm ( [ r1, r2 ] );
    r5 = sqrt ( r1^2 + r2^2 );

    fprintf ( 1, '  %14.6g  %14.6g  %14.6g  %14.6g  %14.6g\n', r1, r2, r3, r4, r5 );

  end

  return
end
