Stochastic rounding: implementation, error analysis and applications
- PMID: 35291325
- PMCID: PMC8905452
- DOI: 10.1098/rsos.211631
Stochastic rounding: implementation, error analysis and applications
Abstract
Stochastic rounding (SR) randomly maps a real number x to one of the two nearest values in a finite precision number system. The probability of choosing either of these two numbers is 1 minus their relative distance to x. This rounding mode was first proposed for use in computer arithmetic in the 1950s and it is currently experiencing a resurgence of interest. If used to compute the inner product of two vectors of length n in floating-point arithmetic, it yields an error bound with constant with high probability, where u is the unit round-off. This is not necessarily the case for round to nearest (RN), for which the worst-case error bound has constant nu. A particular attraction of SR is that, unlike RN, it is immune to the phenomenon of stagnation, whereby a sequence of tiny updates to a relatively large quantity is lost. We survey SR by discussing its mathematical properties and probabilistic error analysis, its implementation, and its use in applications, with a focus on machine learning and the numerical solution of differential equations.
Keywords: IEEE 754; bfloat16; binary16; floating-point arithmetic; machine learning; rounding error analysis.
© 2022 The Authors.
Conflict of interest statement
We declare we have no competing interests.
Figures









Similar articles
-
Stochastic rounding and reduced-precision fixed-point arithmetic for solving neural ordinary differential equations.Philos Trans A Math Phys Eng Sci. 2020 Mar 6;378(2166):20190052. doi: 10.1098/rsta.2019.0052. Epub 2020 Jan 20. Philos Trans A Math Phys Eng Sci. 2020. PMID: 31955687 Free PMC article.
-
Number Formats, Error Mitigation, and Scope for 16-Bit Arithmetics in Weather and Climate Modeling Analyzed With a Shallow Water Model.J Adv Model Earth Syst. 2020 Oct;12(10):e2020MS002246. doi: 10.1029/2020MS002246. Epub 2020 Oct 14. J Adv Model Earth Syst. 2020. PMID: 33282116 Free PMC article.
-
Expressive power of ReLU and step networks under floating-point operations.Neural Netw. 2024 Jul;175:106297. doi: 10.1016/j.neunet.2024.106297. Epub 2024 Apr 9. Neural Netw. 2024. PMID: 38643619
-
Exact arithmetic as a tool for convergence assessment of the IRM-CG method.Heliyon. 2020 Jan 27;6(1):e03225. doi: 10.1016/j.heliyon.2020.e03225. eCollection 2020 Jan. Heliyon. 2020. PMID: 32051861 Free PMC article.
-
Eye-movement models for arithmetic and reading performance.Rev Oculomot Res. 1990;4:455-77. Rev Oculomot Res. 1990. PMID: 7492535 Review.
Cited by
-
Stable recurrent dynamics in heterogeneous neuromorphic computing systems using excitatory and inhibitory plasticity.Nat Commun. 2025 Jul 1;16(1):5522. doi: 10.1038/s41467-025-60697-2. Nat Commun. 2025. PMID: 40595529 Free PMC article.
-
Effective hybrid search technique based constraint mixed-integer programming for smart home residential load scheduling.Sci Rep. 2023 Dec 10;13(1):21870. doi: 10.1038/s41598-023-48717-x. Sci Rep. 2023. PMID: 38072864 Free PMC article.
-
Resource constrained neural network training.Sci Rep. 2024 Jan 29;14(1):2421. doi: 10.1038/s41598-024-52356-1. Sci Rep. 2024. PMID: 38287124 Free PMC article.
-
Periodic orbits in chaotic systems simulated at low precision.Sci Rep. 2023 Jul 14;13(1):11410. doi: 10.1038/s41598-023-37004-4. Sci Rep. 2023. PMID: 37452044 Free PMC article.
References
-
- Connolly MP, Higham NJ, Mary T. 2021. Stochastic rounding and its probabilistic backward error analysis. SIAM J. Sci. Comput. 43, A566-A585. (10.1137/20M1334796) - DOI
-
- Higham NJ, Pranesh S. 2019. Simulating low precision floating-point arithmetic. SIAM J. Sci. Comput. 41, C585-C602. (10.1137/19M1251308) - DOI
-
- Forsythe GE. 1950. Round-off errors in numerical integration on automatic machinery. Bull. Am. Math. Soc. 56, 55-64. (10.1090/S0002-9904-1950-09343-4) - DOI
-
- Huskey HD. 1949. On the precision of a certain procedure of numerical integration. With an appendix by Douglas R. Hartree. J. Res. Nat. Bur. Stand. 42, 57-62. (10.6028/jres.042.005) - DOI
-
- Barnes RCM, Cooke-Yarborough EH, Thomas DGA. 1951. An electronic digital computor using cold cathode counting tubes for storage. Electron. Eng. 23, 286-291. (doi:10.1088/1674-4926/41/2/022404) - DOI
Publication types
LinkOut - more resources
Full Text Sources
Research Materials