ars.R: code to implement adaptive-rejection sampler