How do you compute the midpoint of an interval?

  • Authors:
  • Frédéric Goualard

  • Affiliations:
  • CNRS, LINA, UMR 6241

  • Venue:
  • ACM Transactions on Mathematical Software (TOMS)
  • Year:
  • 2014

Quantified Score

Hi-index 0.00

Visualization

Abstract

The algorithm that computes the midpoint of an interval with floating-point bounds requires some careful devising to handle all possible inputs correctly. We review several implementations from prominent C/C++ interval arithmetic packages and analyze their potential failure to deliver the expected results. We then show how to amend them to avoid common pitfalls. The results presented are also relevant to noninterval arithmetic computation such as the implementation of bisection methods. Enough background on IEEE 754 floating-point arithmetic is provided for this article to serve as a practical introduction to the analysis of floating-point computation.