function errors_test01 ( )

%*****************************************************************************80
%
%% errors_test01()
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    21 August 2017
%
%  Author:
%
%    John Burkardt
%
  p = 665857.0;
  q = 470832.0;

  fprintf ( 1, '\n' );
  fprintf ( 1, '+=============================================+\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  Exercise 1                                 |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|    P = 665857                               |\n' );
  fprintf ( 1, '|    Q = 470832                               |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  Compute:                                   |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|    R = P^2 - 2 * Q^2                        |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  Correct value:                             |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|    R = 1                                    |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '+=============================================+\n' );
  fprintf ( 1, '\n' );

  r = p ^ 2 - 2.0 * q ^ 2;

  fprintf ( 1, '  R = %20.16f\n', r );

  return
end
