 Thus, in practice, one has to find alternative methods of simulation.One such truncated normal generator (implemented in Matlab and
in R (programming language) as trandn.R ) is based on an acceptance rejection idea due to Marsaglia.Despite the slightly suboptimal acceptance rate of Marsaglia (1964) in comparison with Robert (1995), Marsaglia's method is typically faster, because it does not require the costly numerical evaluation of the exponential function.