use double for generator with R uniforms