function errors_test19 ( )

%*****************************************************************************80
%
%% ERRORS_TEST19
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    21 August 2017
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '+=============================================+\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  Exercise 19                                |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|    F1(X) = 1 - Cos(X)                       |\n' );
  fprintf ( 1, '|    F2(X) = Sin^2(X) / ( 1 + Cos(X) )        |\n' );
  fprintf ( 1, '|    F3(X) = Taylor series for 1 - Cos(X)     |\n' );
  fprintf ( 1, '|      around X = 0, up to X^6 terms.         |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  For all X                                  |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|    F1(X) = F2(X)                            |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  For X near 0,                              |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|    F3(X) should approximate F1(X)           |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '+=============================================+\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '       X          1-Cos        Sin^2/(1+Cos)   Taylor\n' );
  fprintf ( 1, '\n' );

  x = 0.5;

  while ( true )

    fx1 = 1.0 - cos ( x );
    fx2 = ( sin ( x ) ) ^ 2 / ( 1.0 + cos ( x ) );
    fx3 = 0.5 * x ^ 2 * ( 1.0 - ( x ^ 2 / 12.0 ) + ( x ^ 4 / 360.0 ) );

    fprintf ( 1, '  %20.16g  %20.16g  %20.16g  %20.16g\n', x, fx1, fx2, fx3 );

    x = 0.25 * x;

    if ( x <= 1.0E-08 )
      break
    end

  end

  return
end
