function horner_test ( )

%*****************************************************************************80
%
%% horner_test tests horner().
%
%  Reference:
%
%    Samuel Conte, Carl de Boor,
%    Elementary Numerical Analysis,
%    Third Edition,
%    SIAM, 2017,
%    ISBN: 978-1-611975-19-2.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'horner_test\n' );
  fprintf ( 1, '  Test horner()\n');

  x = [ 1.5, 0.75, 0.0, -0.75, -1.5 ];
  pn.coefs = [ 0.0, 4.83484, -10.8785, +17.5597, -14.1014 ];
  pn.sites = x;

  y = horner ( pn, x );

  n = length ( x );

  fprintf ( 1, '\n' );
  fprintf ( 1, '         X          P(X)        Tan(X)\n' );
  fprintf ( 1, '\n' );
  for i = 1 : n
    fprintf ( 1, '  %8.4f  %12.6f  %12.6f\n', x(i), y(i), tan(x(i)) );
  end

  return
end

