getTruncatedNormal function

Generate a random sample from a truncated normal distribution.