function determ = clement3_determinant ( n, x, y )

%*****************************************************************************80
%
%% clement3_determinant() returns the determinant of the Clement3 matrix.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    01 October 2007
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the order of A.
%
%    real X(N-1), Y(N-1), the first super and
%    subdiagonals of the matrix A.
%
%  Output:
%
%    real DETERM, the determinant of A.
%
  if ( mod ( n, 2 ) == 1 )

    determ = 0.0;

  else

    determ = 1.0;
    for i = 1 : 2 : n-1
      determ = determ * x(i) * y(i);
    end

    if ( mod ( n/2, 2 ) == 1 )
      determ = - determ;
    end

  end

  return
end
