GEN40 — Generates a random distribution using a distribution histogram.


Generates a continuous random distribution function starting from the shape of a user-defined distribution histogram.


f # time size 40 shapetab


The shape of histogram must be stored in a previously defined table, in fact shapetab argument must be filled with the number of such table.

Histogram shape can be generated with any other GEN routines. Since no interpolation is used when GEN40 processes the translation, it is suggested that the size of the table containing the histogram shape to be reasonably big, in order to obtain more precision (however after the processing the shaping-table can be destroyed in order to re-gain memory).

This subroutine is designed to be used together with cuserrnd opcode (see cuserrnd for more information).


Author: Gabriel Maldonado