Use distribution function with rejection sampling.