function errors_test04 ( )

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

  fprintf ( 1, '\n' );
  fprintf ( 1, '+=============================================+\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  Exercise 4                                 |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|    Q = 1.091608                             |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  Compute:                                   |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|    R =                                      |\n' );
  fprintf ( 1, '|        170.4  * Q^3                         |\n' );
  fprintf ( 1, '|      - 356.41 * Q^2                         |\n' );
  fprintf ( 1, '|      + 168.97 * Q                           |\n' );
  fprintf ( 1, '|      +  18.601                              |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  Correct value:                             |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|    R = 0.821248E-13                         |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '+=============================================+\n' );
  fprintf ( 1, '\n' );

  q = 1.091608;

  c = [ 18.601, 168.97, - 356.41, 170.4 ];

  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
