function multiply_cordic_test ( )

%*****************************************************************************80
%
%% multiply_cordic_test() tests multiply_cordic().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    27 June 2018
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'multiply_cordic_test():\n' );
  fprintf ( 1, '  multiply_cordic() computes Z = X * Y\n' );
  fprintf ( 1, '  using the CORDIC algorithm.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '        X             Y               Z                 Z\n' );
  fprintf ( 1, '                                      (X*Y)             (CORDIC)\n' );
  fprintf ( 1, '\n' );

  for i = 1 : 20

    x = - 100.0 + 200.0 * rand ( );
    y = - 100.0 + 200.0 * rand ( );
    z1 = x * y;
    z2 = multiply_cordic ( x, y );

    fprintf ( 1, '  %12f  %12f  %16.8f  %16.8f\n', x, y, z1, z2 );

  end

  return
end
