Drawing Random Floating-point Numbers from an Interval

被引:2
|
作者
Goualard, Frederic [1 ,2 ]
机构
[1] CNRS, LS2N, UMR 6004, Nantes, France
[2] Univ Nantes, LS2N, CNRS, UMR 6004, 2 Rue Houssiniere,BP 92208, F-44322 Nantes 3, France
关键词
Floating-point number; IEEE; 754; standard; random float;
D O I
10.1145/3503512
中图分类号
TP39 [计算机的应用];
学科分类号
081203 ; 0835 ;
摘要
Drawing a floating-point number uniformly at random from an interval [a, b) is usually performed by a location-scale transformation of some floating-point number drawn uniformly from [0, 1). Due to the weak properties of floating-point arithmetic, such a transformation cannot ensure respect of the bounds, uniformity or spatial equidistributivity. We investigate and quantify precisely these shortcomings while reviewing the actual implementations of the method in major programming languages and libraries, and we propose a simple algorithm to avoid these shortcomings without compromising performances.
引用
收藏
页数:24
相关论文
共 50 条
  • [1] Generating Random Floating-Point Numbers by Dividing Integers: A Case Study
    Goualard, Frederic
    COMPUTATIONAL SCIENCE - ICCS 2020, PT II, 2020, 12138 : 15 - 28
  • [2] Arithmetic Coding for Floating-Point Numbers
    Fischer, Marc
    Riedel, Oliver
    Lechler, Armin
    Verl, Alexander
    2021 IEEE CONFERENCE ON DEPENDABLE AND SECURE COMPUTING (DSC), 2021,
  • [3] Konrad Zuse and Floating-Point Numbers
    Winkler, Juergen F. H.
    COMMUNICATIONS OF THE ACM, 2012, 55 (10) : 6 - 7
  • [4] A combined interval and floating-point divider
    Stine, JE
    Schulte, MJ
    CONFERENCE RECORD OF THE THIRTY-SECOND ASILOMAR CONFERENCE ON SIGNALS, SYSTEMS & COMPUTERS, VOLS 1 AND 2, 1998, : 218 - 222
  • [5] A combined interval and floating-point comparator
    Kaas, CM
    Stine, JE
    CONFERENCE RECORD OF THE THIRTY-SEVENTH ASILOMAR CONFERENCE ON SIGNALS, SYSTEMS & COMPUTERS, VOLS 1 AND 2, 2003, : 2242 - 2246
  • [6] Floating-point unit processing denormalized numbers
    Li, Z
    He, H
    Sun, YH
    2005 6th International Conference on ASIC Proceedings, Books 1 and 2, 2005, : 90 - 93
  • [7] CIRCUIT FINDS A FLOATING-POINT NUMBERS MSB
    JENG, JC
    EDN, 1985, 30 (15) : 246 - 246
  • [8] Optimization Modulo the Theory of Floating-Point Numbers
    Trentin, Patrick
    Sebastiani, Roberto
    AUTOMATED DEDUCTION, CADE 27, 2019, 11716 : 550 - 567
  • [9] FLOATING-POINT NUMBERS WITH ERROR-ESTIMATES
    MASOTTI, G
    COMPUTER-AIDED DESIGN, 1993, 25 (09) : 524 - 538
  • [10] An Interval Compiler for Sound Floating-Point Computations
    Rivera, Joao
    Franchetti, Franz
    Puschel, Markus
    CGO '21: PROCEEDINGS OF THE 2021 IEEE/ACM INTERNATIONAL SYMPOSIUM ON CODE GENERATION AND OPTIMIZATION (CGO), 2021, : 52 - 64