function errors_test17 ( )

%*****************************************************************************80
%
%% ERRORS_TEST17
%
%  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 17                                |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  A =                                        |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|     2.718281828                             |\n' );
  fprintf ( 1, '|    -3.141592654                             |\n' );
  fprintf ( 1, '|     1.414213562                             |\n' );
  fprintf ( 1, '|     0.5772156649                            |\n' );
  fprintf ( 1, '|     0.3010299957                            |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  B =                                        |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|        1486.2497                            |\n' );
  fprintf ( 1, '|      878366.9879                            |\n' );
  fprintf ( 1, '|        - 22.37492                           |\n' );
  fprintf ( 1, '|     4773714.647                             |\n' );
  fprintf ( 1, '|           0.000185049                       |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  Compute the scalar product:                |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|    R = A dot B                              |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|  Correct value:                             |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '|    R = - 0.100657107E-10                    |\n' );
  fprintf ( 1, '|                                             |\n' );
  fprintf ( 1, '+=============================================+\n' );
  fprintf ( 1, '\n' );

  n = 5;
  a = [ 2.718281828; -3.141592654; 1.414213562; 0.5772156649; 0.3010299957 ];
  b = [ 1486.2497; 878366.9879; - 22.37492; 4773714.647; 0.000185049 ];

  r1 = 0.0;
  for i = 1 : n
    r1 = r1 + a(i) * b(i);
  end

  fprintf ( 1, '  R1 = standard loop = %20.16g\n', r1 );

  r2 = sum ( a(1:n) .* b(1:n) );
  fprintf ( 1, '  R2 = sum(a(1:n) .* b(1:n) ) = %20.16g\n', r1 );

  r3 = a' * b;
  fprintf ( 1, '  R3 = A'' * B = %20.16g\n', r2 );

  return
end