Better rand_doubles generation