The most well-known feature of floating-point arithmetic is the limited precision, which creates round-offerrors and inaccuracies. Another important issue is the limited range, which creates underflow and overflow, even if this topic is dismissed most of the time. This article shows a very simple example: the average of two floating-point numbers. As we want to take exceptional behaviors into account, we cannot use the naive formula (x+y)/2. Based on hints given by Sterbenz, we first write an accurate program and formally prove its properties. An interesting fact is that Sterbenz did not give this program, but only specified it. We prove this specification and include a new property: a precise certified error bound. We also present and formally prove a new algorithm that computes the correct rounding of the average of two floating-point numbers. It is more accurate than the previous one and is correct whatever the inputs.
CITATION STYLE
Boldo, S. (2015). Formal verification of programs computing the floating-point average. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) (Vol. 9407, pp. 17–32). Springer Verlag. https://doi.org/10.1007/978-3-319-25423-4_2
Mendeley helps you to discover research relevant for your work.