Table of Contents
Fetching ...

Functions to Support Input and Output of Intervals

M. H. van Emden, B. Moa, S. C. Somosan

TL;DR

The paper tackles the challenge of reliable input and output for interval arithmetic under directed rounding. It develops first-principles algorithms for decimal input and output, enabling the computation of the narrowest floating-point interval containing a given decimal numeral and the decimal numeral equal to a floating-point number, respectively. Core techniques include binarization and normalization for input, Knuth-style radix conversion to binary, and fltoem/decimalize/decOut for output, with careful handling to produce intervals that contain the target value or are contained within the input when appropriate. The work yields portable, language- and machine-independent building blocks that improve the correctness and practicality of interval I/O, balancing accuracy with efficiency where possible.

Abstract

Interval arithmetic is hardly feasible without directed rounding as provided, for example, by the IEEE floating-point standard. Equally essential for interval methods is directed rounding for conversion between the external decimal and internal binary numerals. This is not provided by the standard I/O libraries. Conversion algorithms exist that guarantee identity upon conversion followed by its inverse. Although it may be possible to adapt these algorithms for use in decimal interval I/O, we argue that outward rounding in radix conversion is computationally a simpler problem than guaranteeing identity. Hence it is preferable to develop decimal interval I/O ab initio, which is what we do in this paper.

Functions to Support Input and Output of Intervals

TL;DR

The paper tackles the challenge of reliable input and output for interval arithmetic under directed rounding. It develops first-principles algorithms for decimal input and output, enabling the computation of the narrowest floating-point interval containing a given decimal numeral and the decimal numeral equal to a floating-point number, respectively. Core techniques include binarization and normalization for input, Knuth-style radix conversion to binary, and fltoem/decimalize/decOut for output, with careful handling to produce intervals that contain the target value or are contained within the input when appropriate. The work yields portable, language- and machine-independent building blocks that improve the correctness and practicality of interval I/O, balancing accuracy with efficiency where possible.

Abstract

Interval arithmetic is hardly feasible without directed rounding as provided, for example, by the IEEE floating-point standard. Equally essential for interval methods is directed rounding for conversion between the external decimal and internal binary numerals. This is not provided by the standard I/O libraries. Conversion algorithms exist that guarantee identity upon conversion followed by its inverse. Although it may be possible to adapt these algorithms for use in decimal interval I/O, we argue that outward rounding in radix conversion is computationally a simpler problem than guaranteeing identity. Hence it is preferable to develop decimal interval I/O ab initio, which is what we do in this paper.

Paper Structure

This paper contains 10 sections, 4 equations, 13 figures.

Figures (13)

  • Figure 1: Why standard input cannot be relied on to obtain an interval for some of the common fractions.
  • Figure 2: A C++ function to convert a rational $p/q$ to a floating-point number. The function next() produces the least floating-point number greater than its argument.
  • Figure 3: A C++ function to scale the fraction $p/q$.
  • Figure 4: A C++ function to double a number of the form $\sum_{i=1}^n d_i 10^{-i}$ where the $d_1,\ldots,d_n$ are given in the string argument mnts.
  • Figure 5: A C++ function to binarize a number of the form $10^e\sum_{i=1}^n d_i 10^{-i}$ where the digits $d_1,\ldots,d_n$ are given in the string argument mnts. If we denote the values on exit by adding primes, we have $10^e\sum_{i=1}^n d_i 10^{-i}= 2^{e'}\sum_{i=1}^{n'} {d'}_i 10^{-i}$
  • ...and 8 more figures