Inexactness and Correction of Floating-Point Reciprocal, Division and Square Root

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Dutton, Lucas M., Anand, Christopher Kumar, Enenkel, Robert, Müller, Silvia Melitta
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866911820663488512
author Dutton, Lucas M.
Anand, Christopher Kumar
Enenkel, Robert
Müller, Silvia Melitta
author_facet Dutton, Lucas M.
Anand, Christopher Kumar
Enenkel, Robert
Müller, Silvia Melitta
contents Floating-point arithmetic performance determines the overall performance of important applications, from graphics to AI. Meeting the IEEE-754 specification for floating-point requires that final results of addition, subtraction, multiplication, division, and square root are correctly rounded based on the user-selected rounding mode. A frustrating fact for implementers is that naive rounding methods will not produce correctly rounded results even when intermediate results with greater accuracy and precision are available. In contrast, our novel algorithm can correct approximations of reciprocal, division and square root, even ones with slightly lower than target precision. In this paper, we present a family of algorithms that can both increase the accuracy (and potentially the precision) of an estimate and correctly round it according to all binary IEEE-754 rounding modes. We explain how it may be efficiently implemented in hardware, and for completeness, we present proofs that it is not necessary to include equality tests associated with round-to-nearest-even mode for reciprocal, division and square root functions, because it is impossible for input(s) in a given precision to have exact answers exactly midway between representable floating-point numbers in that precision. In fact, our simpler proofs are sometimes stronger.
format Preprint
id arxiv_https___arxiv_org_abs_2404_00387
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Inexactness and Correction of Floating-Point Reciprocal, Division and Square Root
Dutton, Lucas M.
Anand, Christopher Kumar
Enenkel, Robert
Müller, Silvia Melitta
Mathematical Software
Hardware Architecture
Floating-point arithmetic performance determines the overall performance of important applications, from graphics to AI. Meeting the IEEE-754 specification for floating-point requires that final results of addition, subtraction, multiplication, division, and square root are correctly rounded based on the user-selected rounding mode. A frustrating fact for implementers is that naive rounding methods will not produce correctly rounded results even when intermediate results with greater accuracy and precision are available. In contrast, our novel algorithm can correct approximations of reciprocal, division and square root, even ones with slightly lower than target precision. In this paper, we present a family of algorithms that can both increase the accuracy (and potentially the precision) of an estimate and correctly round it according to all binary IEEE-754 rounding modes. We explain how it may be efficiently implemented in hardware, and for completeness, we present proofs that it is not necessary to include equality tests associated with round-to-nearest-even mode for reciprocal, division and square root functions, because it is impossible for input(s) in a given precision to have exact answers exactly midway between representable floating-point numbers in that precision. In fact, our simpler proofs are sometimes stronger.
title Inexactness and Correction of Floating-Point Reciprocal, Division and Square Root
topic Mathematical Software
Hardware Architecture
url https://arxiv.org/abs/2404.00387