function x = planck_sample ( a, b )

%*****************************************************************************80
%
%% planck_sample() samples the Planck PDF.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    26 October 2004
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Luc Devroye,
%    Non-Uniform Random Variate Generation,
%    Springer Verlag, 1986, pages 552.
%
%  Input:
%
%    real A, B, the parameters of the PDF.
%    0.0 < A,
%    0.0 < B.
%
%  Output:
%
%    real X, a sample of the PDF.
%
  a2 = 0.0;
  b2 = 1.0;
  c2 = b + 1.0;

  g = gamma_sample ( a2, b2, c2 );

  z = zipf_sample ( c2 );

  x = g / ( a * z );

  return
end
