function errors_test02 ( )

%*****************************************************************************80
%
%% ERRORS_TEST02
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    21 August 2017
%
%  Author:
%
%    John Burkardt
%
  p = 10864.0;
  q = 18817.0;

  fprintf ( 1, '\n' );
  fprintf ( 1, '+=============================================+\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  Exercise 2                                 |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|    P = 10864                                |\n' );
  fprintf ( 1, '|    Q = 18817                                |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  Compute:                                   |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|    R = 9 * P^4 - Q^4 + 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 = 9.0 * p ^ 4 - q ^ 4 + 2.0 * q ^ 2;

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

  return
end
