function x = frechet_sample ( alpha )

%*****************************************************************************80
%
%% frechet_sample() samples the Frechet PDF.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    03 September 2008
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real ALPHA, the parameter.
%    It is required that 0.0 < ALPHA.
%
%  Output:
%
%    real X, a sample of the PDF.
%
  if ( alpha <= 0.0 )
    fprintf ( 1, '\n' );
    fprintf ( 1, 'FRECHET_SAMPLE - Fatal error!\n' );
    fprintf ( 1, '  ALPHA <= 0.0.\n' );
    error ( 'FRECHET_SAMPLE - Fatal error!' );
  end

  cdf = rand ( 1, 1 );

  x = frechet_cdf_inv ( cdf, alpha );

  return
end
