sub r2 { my ($low, $high) = @_; $low + rand($high-$low); } sub myrand { my ($x, $y) = @_; rand() < .5 ? r2($x/$y, $x) : r2($x,$x*$y); }