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 条
  • [31] Printing floating-point numbers a faster, always correct method
    2016, Association for Computing Machinery, 2 Penn Plaza, Suite 701, New York, NY 10121-0701, United States (20-22-January-2016):
  • [32] Extending Modelchecking with ProB to Floating-Point Numbers and Hybrid Systems
    Rutenkolk, Kristin
    RIGOROUS STATE-BASED METHODS, ABZ 2023, 2023, 14010 : 366 - 370
  • [33] Interval Slopes as a Numerical Abstract Domain for Floating-Point Variables
    Chapoutot, Alexandre
    STATIC ANALYSIS, 2010, 6337 : 184 - 200
  • [34] Accurate Floating-point Operation using Controlled Floating-point Precision
    Zaki, Ahmad M.
    Bahaa-Eldin, Ayman M.
    El-Shafey, Mohamed H.
    Aly, Gamal M.
    2011 IEEE PACIFIC RIM CONFERENCE ON COMMUNICATIONS, COMPUTERS AND SIGNAL PROCESSING (PACRIM), 2011, : 696 - 701
  • [35] Refinement of rational end-points real numbers by means of floating-point numbers
    Ait-Ameur, Y
    SCIENCE OF COMPUTER PROGRAMMING, 1999, 33 (02) : 133 - 162
  • [36] Floating-point arithmetic
    Boldo, Sylvie
    Jeannerod, Claude-Pierre
    Melquiond, Guillaume
    Muller, Jean-Michel
    ACTA NUMERICA, 2023, 32 : 203 - 290
  • [37] On floating-point summation
    Espelid, TO
    SIAM REVIEW, 1995, 37 (04) : 603 - 607
  • [38] FLOATING-POINT COMPUTATION
    STERBENZ, P
    TRANSACTIONS OF THE NEW YORK ACADEMY OF SCIENCES, 1974, 36 (06): : 591 - 591
  • [39] Floating-point tricks
    Blinn, JF
    IEEE COMPUTER GRAPHICS AND APPLICATIONS, 1997, 17 (04) : 80 - 84
  • [40] FLOATING-POINT REPLY
    WILLIAMS, A
    DR DOBBS JOURNAL, 1993, 18 (13): : 10 - 10