function pdf = chebyshev2_pdf ( x )

%*****************************************************************************80
%
%% chebyshev2_pdf() evaluates the Chebyshev2 PDF.
%
%  Formula:
%
%    PDF(X) = 2 * sqrt ( 1 - x^2 ) / pi for -1 < X < 1
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    10 August 2016
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real X(*), the argument of the PDF.
%
%  Output:
%
%    real PDF(*), the value of the PDF.
%
  pdf = zeros ( size ( x ) );

  i = find ( x < -1.0 | 1.0 < x );
  j = find ( -1.0 <= x & x <= 1.0 );

  pdf(i) = 0.0;
  pdf(j) = 2.0 * sqrt ( 1.0 - x(j) .^ 2 ) / pi;

  return
end
