function errors_test05 ( )

%*****************************************************************************80
%
%% ERRORS_TEST05
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    21 August 2017
%
%  Author:
%
%    John Burkardt
%
  n = 4;

  fprintf ( 1, '\n' );
  fprintf ( 1, '+=============================================+\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  Exercise 5                                 |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|    Q = 0.707107                             |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  Compute:                                   |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|    R =                                      |\n' );
  fprintf ( 1, '|         8118 * Q^4                          |\n' );
  fprintf ( 1, '|      - 11482 * Q^3                          |\n' );
  fprintf ( 1, '|      +         Q^2                          |\n' );
  fprintf ( 1, '|      +  5741 * Q                            |\n' );
  fprintf ( 1, '|      -  2030                                |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  Correct value:                             |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|    R = - 0.191527325270E-10                 |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '+=============================================+\n' );
  fprintf ( 1, '\n' );

  q = 0.707107;

  c = [ - 2030.0, 5741.0, 1.0, - 11482.0, 8118.0 ];

  r1 = r8poly_value ( n, c, q );

  fprintf ( 1, '  Direct evaluation R = %20.16g\n', r1 );

  r2 = r8poly_value_horner ( n, c, q );

  fprintf ( 1, '  Horner evaluation R = %20.16g\n', r2 );

  return
end
