function errors_test27 ( )

%*****************************************************************************80
%
%% errors_test27() tests tan() and atan().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    21 August 2017
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '+=============================================+\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  Exercise 27                                |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  TAN(X) and ATAN(X) are inverse functions.  |\n' );
  fprintf ( 1, '|  Therefore, it should always be that:       |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|    TAN(ATAN(X)) = X                         |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '+=============================================+\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '       X         TAN(ATAN(X))    Error\n' );
  fprintf ( 1, '\n' );

  x = 1.0;

  for i = 0 : 20
    atx = atan ( x );
    tatx = tan ( atx );
    e = abs ( tatx - x );
    fprintf ( 1, '  %14.6g  %14.6g  %14.6g\n', x, tatx, e );
    x = x * 10.0;
  end

  return
end
