random number generators for calc

tino ttk448 at gmail.com
Wed Nov 28 14:07:21 PST 2012

> >What is your opinion on implementing generators for other
> >distributions like normal and all the ones listed under statistics
> >(which calculate densities but don't generate)?
> Well, re-implementing the existing RAND and RANDBETWEEN with the new
> generator is no brainer.  But I'm not sure if we really need to
> provide multiple variants for different random number generators.
> What we could do is to specify a run-time option for the algorithm
> for the normal RAND and RANDBETWEEN functions rather than providing
> multiple variants.  That would be my preference.  We already have
> formula engine options in Tools - Options (in the Formula tab page),
> so adding another one shouldn't be too difficult.

Not sure I understand. My suggestion is that boost::mt19937 is the
only underlying generator algorithm (generating int's) which is then
transformed to get RAND() and RANDBETWEEN(i,j). Yet both are simple
uniform distributions but the user might need Normal distributed
random variables and then RAND() is of little use. So a function like
RANDNORMAL() which generates N(0,1) (still using boost::mt19937)
random numbers would be a useful addition, wouldn't it?

Cheers, Tino

More information about the LibreOffice mailing list