function [ fxx, fxy, fyy ] = f01_f2 ( n, x, y )

%*****************************************************************************80
%
%% f01_f2() returns second derivatives of function 1.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    29 January 2012
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the number of evaluation points.
%
%    real X(N,1), Y(N,1), the evalution points.
%
%  Output:
%
%    real FXX(N,1), FXY(N,1), FYY(N,1), second derivatives.
%
  t1(1:n,1) = exp ( - ( ( 9.0 * x(1:n,1) - 2.0 ).^2 ...
                    + ( 9.0 * y(1:n,1) - 2.0 ).^2 ) / 4.0 );
  t2(1:n,1) = exp ( - ( ( 9.0 * x(1:n,1) + 1.0 ).^2 ) / 49.0 ...
                    - ( 9.0 * y(1:n,1) + 1.0 ) / 10.0 );
  t3(1:n,1) = exp ( - ( ( 9.0 * x(1:n,1) - 7.0 ).^2 ...
                    + ( 9.0 * y(1:n,1) - 3.0 ).^2 ) / 4.0 );
  t4(1:n,1) = exp ( -   ( 9.0 * x(1:n,1) - 4.0 ).^2 ...
                    - ( 9.0 * y(1:n,1) - 7.0 ).^2 );

  fxx(1:n,1) = ...
      15.1875 * ( ( 9.0 * x(1:n,1) - 2.0 ).^2 - 2.0 )  .* t1(1:n,1) ...
    + 60.75   * ( ( 9.0 * x(1:n,1) + 1.0 ).^2 - 24.5 ) .* t2(1:n,1) ...
    + 10.125  * ( ( 9.0 * x(1:n,1) - 7.0 ).^2 - 2.0 )  .* t3(1:n,1) ...
    - 64.8    * ( ( 9.0 * x(1:n,1) - 4.0 ).^2 - 0.5 )  .* t4(1:n,1);

  fxy(1:n,1) = ...
      15.1875 * ( 9.0 * x(1:n,1) - 2.0 ) .* ( 9.0 * y(1:n,1) - 2.0 ) .* t1(1:n,1) ...
    + ( 243.0 / 980.0 ) * ( 9.0 * x(1:n,1) + 1.0 )               .* t2(1:n,1) ...
    + 10.125 * ( 9.0 * x(1:n,1) - 7.0 ) .* ( 9.0 * y(1:n,1) - 3.0 ) .* t3(1:n,1) ...
    - 64.8 * ( 9.0 * x(1:n,1) - 4.0 ) .* ( 9.0 * y(1:n,1) - 7.0 ) .* t4(1:n,1);

  fyy(1:n,1) = ...
      15.1875 * ( ( 9.0 * y(1:n,1) - 2.0 ).^2 - 2.0 ) .* t1(1:n,1) ...
    + 0.6075  *                                        t2(1:n,1) ...
    + 10.125  * ( ( 9.0 * y(1:n,1) - 3.0 ).^2 - 2.0 ) .* t3(1:n,1) ...
    - 64.8    * ( ( 9.0 * y(1:n,1) - 7.0 ).^2 - 0.5 ) .* t4(1:n,1);

  return
end
