Formal Verification of Programs Computing the Floating-Point Average

Sylvie Boldo 1, 2, *
* Corresponding author
2 TOCCATA - Formally Verified Programs, Certified Tools and Numerical Computations
LRI - Laboratoire de Recherche en Informatique, Inria Saclay - Ile de France
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 metadatas

Cited literature [14 references]  Display  Hide  Download

https://hal.inria.fr/hal-01174892
Contributor : Sylvie Boldo <>
Submitted on : Friday, July 10, 2015 - 10:37:12 AM
Last modification on : Monday, December 9, 2019 - 5:24:07 PM
Long-term archiving on: Monday, October 12, 2015 - 11:30:34 AM

File

article.pdf
Files produced by the author(s)

Identifiers

  • HAL Id : hal-01174892, version 1

Citation

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⟩

Share

Metrics

Record views

478

Files downloads

746