Skip to Main content Skip to Navigation
New interface
Conference papers

Formal Verification of Programs Computing the Floating-Point Average

Sylvie Boldo 1, 2 
Abstract : The most well-known feature of floating-point arithmetic is the limited precision, which creates round-off errors 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.
Complete list of metadata

Cited literature [14 references]  Display  Hide  Download
Contributor : Sylvie Boldo Connect in order to contact the contributor
Submitted on : Friday, July 10, 2015 - 10:37:12 AM
Last modification on : Saturday, June 25, 2022 - 10:16:51 PM
Long-term archiving on: : Monday, October 12, 2015 - 11:30:34 AM


Files produced by the author(s)


  • HAL Id : hal-01174892, version 1


Sylvie Boldo. Formal Verification of Programs Computing the Floating-Point Average. 17th International Conference on Formal Engineering Methods, Nov 2015, Paris, France. pp.17-32. ⟨hal-01174892⟩



Record views


Files downloads