in reply to custom random number generator
$r = $x * $y ** (1 - rand 2); [download]
update:
Or if you want to reduce the variance:
$r = $x * $y ** ((1 - rand 2) ** $n) [download]