Perfect Random Floating-Point Numbers: A New Algorithm

2025-05-07
Perfect Random Floating-Point Numbers: A New Algorithm

Traditional methods for generating random floating-point numbers suffer from precision loss and bias. This paper introduces a new efficient algorithm that generates perfectly uniform random floating-point numbers in the interval [0, 1), addressing the shortcomings of traditional approaches. The algorithm proceeds in two steps: first, generating a fixed-point random number with a specific granularity; second, filling in the remaining precision bits based on the rounding mode. The algorithm's performance is comparable to traditional methods, and testing verifies its uniformity and accuracy. This research is significant for simulations and computations relying on precise floating-point random numbers.

Development