function y = lindberg_exact ( x )

%*****************************************************************************80
%
%% lindberg_exact() evaluates the exact solution of lindberg_ode().
%
%  Discussion:
%
%    The formula was supplied by Wenlong Pei.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    18 August 2021
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real x(n): the evaluation points.
%
%  Output:
%
%    real y(n,4): the function values.
%
  n = length ( x );
  y = zeros ( n, 4 );
  g1 = 10.0^4 * ( x + 2.0 * exp ( - x ) - 2.0 );
  g2 = 10.0^4 * ( 1.0 - exp ( - x ) - x .* exp ( -x ) );

  y(:,1) = exp ( g1 ) .* ( cos ( g2 ) + sin ( g2 ) );
  y(:,2) = exp ( g1 ) .* ( cos ( g2 ) - sin ( g2 ) );
  y(:,3) = 1.0 - 2.0 * exp ( - x(:) );
  y(:,4) = x(:) .* exp ( - x(:) );
 
  return
end

