Without further constraints, why not take a random number, if it's less than 0.5, return a random number between x/y and x; if the first random number exceeds 0.5, return a random number between x and x*y. Something like (untested):

I think you'll like this. Not only does it randomize your values for you, but it gives a visual display of the result so you can see the distribution. Change the weight to see how it affects things - larger numbers mean closer to $x, smaller means further, with 1 being classic bell curve.