Examples of random() in custom distribution?

We dont have a good example, but have a look at the test case for some inspiration: