function errors_test12 ( )

%*****************************************************************************80
%
%% errors_test12()
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    23 August 2017
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '+=============================================+\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  Exercise 12                                |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  Solve a linear system A * x = b            |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  A is the Hilbert matrix of order 9,        |\n' );
  fprintf ( 1, '|  multiplied by the least common multiple of |\n' );
  fprintf ( 1, '|  1 through 9, so all entries are integers.  |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  B = (1,0,0,...,0)                          |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  We are interested in the first component   |\n' );
  fprintf ( 1, '|  X(1) of the solution vector.               |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  Correct X(1):                              |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|    6.611036022800E-06                       |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '+=============================================+\n' );

  n = 9;
  a = zeros ( n, n );

  mult = i4_lcm_12n ( n );

  for i = 1 : n
    for j = 1 : n
      a(i,j) = mult / ( i + j - 1 );
    end
  end

  b = zeros ( n, 1 );
  b(1) = 1.0;

  x1(1) = 6.611036022800E-06;

  x2 = a \ b;

  fprintf ( 1, '\n' );
  fprintf ( 1, '  First solution component only:\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Exact X1(1)    = %20.16g\n', x1(1) );
  fprintf ( 1, '  Computed X2(1) = %20.16g\n', x2(1) );

  return
end
