You can create a table with the CDF of the (arbitrarily complex) distribution, and do a lookup (or piecewise-linear interpolation) using a random uniform variable (i.e., RAND()). That method can be used to generate deviates from any distribution.
For a discussion, see https://en.wikipedia.org/wiki/Invers...ing#The_method
Bookmarks