function x = normal_truncated_a_sample ( mu, s, a )

%*****************************************************************************80
%
%% normal_truncated_a_sample() samples the lower truncated Normal PDF.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    20 August 2013
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real MU, S, the mean and standard deviation of the
%    parent Normal distribution.
%
%    real A, the lower truncation limit.
%
%  Output:
%
%    real X, a sample of the PDF.
%
  alpha = ( a - mu ) / s;
% beta = Inf;

  alpha_cdf = normal_01_cdf ( alpha );
  beta_cdf = 1.0;

  u = rand ( 1, 1 );
  xi_cdf = alpha_cdf + u * ( beta_cdf - alpha_cdf );
  xi = normal_01_cdf_inv ( xi_cdf );

  x = mu + s * xi;

  return
end
