How do you compute the midpoint of an interval?
Résumé
The algorithm that computes the midpoint of an interval with floating-point bounds requires some careful devising to correctly handle all possible inputs. We review several implementations from prominent C/C++ interval arithmetic packages and analyze their potential failure to deliver correct results. We then highlight two implementations that avoid common pitfalls. The results presented are also relevant to non-interval arithmetic computation such as the implementation of bisection methods. Enough background on IEEE 754 floating-point arithmetic is provided for this paper to serve as a practical introduction to the analysis of floating-point computation.
Origine | Fichiers produits par l'(les) auteur(s) |
---|
Loading...