function errors_test09 ( )

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

  c = [ -945804881.0, 1753426039.0, -1083557822.0, 223200658.0 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, '+=============================================+\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  Exercise 9                                 |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|    P(X) =                                   |\n' );
  fprintf ( 1, '|         223200658 * X^3                     |\n' );
  fprintf ( 1, '|      - 1083557822 * X^2                     |\n' );
  fprintf ( 1, '|      + 1753426039 * X                       |\n' );
  fprintf ( 1, '|       - 945804881                           |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  Evaluate at 11 equally spaced values       |\n' );
  fprintf ( 1, '|  from 1.61801916 to 1.61801917              |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  Correct table:                             |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  ===== X =====    ========= P(X) ========   |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|    1.618019160  - 0.17081105112320e-11      |\n' );
  fprintf ( 1, '|    1.618019161  - 0.89804011575510e-12      |\n' );
  fprintf ( 1, '|    1.618019162  - 0.34596536943057e-12      |\n' );
  fprintf ( 1, '|    1.618019163  - 0.51884933054474e-13      |\n' );
  fprintf ( 1, '|    1.618019164  - 0.15797467422848e-13      |\n' );
  fprintf ( 1, '|    1.618019165  - 0.23770163333175e-12      |\n' );
  fprintf ( 1, '|    1.618019166  - 0.71759609157723e-12      |\n' );
  fprintf ( 1, '|    1.618019167  - 0.14554795029553e-11      |\n' );
  fprintf ( 1, '|    1.618019168  - 0.24513505282621e-11      |\n' );
  fprintf ( 1, '|    1.618019169  - 0.37052078282936e-11      |\n' );
  fprintf ( 1, '|    1.618019170  - 0.52170500638460e-11      |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '+=============================================+\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  R1: compute P(X) the regular way.\n' );
  fprintf ( 1, '  R2: compute P(X) using Horner''s method.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  X, R1, R2\n' );
  fprintf ( 1, '\n' );

  m = 10;

  for i = 0 : m

    x = ( ( m - i ) * 1.61801916 ...
        + (     i ) * 1.61801917 ) / m;

    r1 = r8poly_value ( n, c, x );

    r2 = r8poly_value_horner ( n, c, x );

    fprintf ( 1, '  %20.16g  %20.16g  %20.16g\n', x, r1, r2 );

  end

  return
end
