function pdf = chebyshev1_pdf ( x )

%*****************************************************************************80
%
%% chebyshev1_pdf() evaluates the Chebyshev1 PDF.
%
%  Formula:
%
%    PDF(X) = 1 / pi / sqrt ( 1 - x^2 ) for -1 < X < 1
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    11 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) = 1.0 ./ pi ./ sqrt ( 1.0 - x(j) .^ 2 );

  return
end
