Exact real arithmetic: a case study in higher order programming

Two methods for implementing ezact real arithmetic are explored One method is based on formulating real numbers as functions that map rational tolerances to rational approximations. This approach, which was developed by constructive mathematicians as a concrete formalization of the real numbers, has lead to a surprisingly successful implementation. The second method formulates real numbers as potentially infinite sequences of digits, evaluated on demand. This approach has frequently been advocated by proponents of lazy functional languages in the computer science community Ironically, it leads to much less satisfactory implementations. We discuss the theoretical problems involved m both methods, give algortthms for the basic arithmetic operations, and give an empirical comparison of the two techniques. We conclude wtth some general observations about the lazy evaluation paradigm and its implementation.

[1]  A. Avizienis Binary-Compatible Signed-Digit Arithmetic , 1899 .

[2]  A. Avizeinis,et al.  Signed Digit Number Representations for Fast Parallel Arithmetic , 1961 .

[3]  Algirdas Avizienis,et al.  Signed-Digit Numbe Representations for Fast Parallel Arithmetic , 1961, IRE Trans. Electron. Comput..

[4]  J. H. Wilkinson The algebraic eigenvalue problem , 1966 .

[5]  Donald Ervin Knuth,et al.  The Art of Computer Programming , 1968 .

[6]  Jr. Hartley Rogers Theory of Recursive Functions and Effective Computability , 1969 .

[7]  John Myhill,et al.  What Is a Real Number , 1972 .

[8]  Daniel E. Atkins,et al.  Introduction to the Role of Redundancy in Computer Arithmetic , 1975, Computer.

[9]  Mary Jane Irwin,et al.  On-line algorithms for the design of pipeline architectures , 1979, ISCA '79.

[10]  Robert Cartwright,et al.  A constructive alternative to axiomatic data type definitions , 1980, LISP Conference.

[11]  E. Wiedmer,et al.  Computing with Infinite Objects , 1980, Theor. Comput. Sci..

[12]  Robert Cartwright,et al.  Formal program testing , 1981, POPL '81.

[13]  Robert Cartwright,et al.  The semantics of lazy (and industrious) evaluation , 1982, LFP '82.

[14]  Dana S. Scott,et al.  Lectures on a Mathematical Theory of Computation , 1982 .

[15]  Robert Cartwright Recursive Programs as Definitions in First Order Logic , 1984, SIAM J. Comput..

[16]  Luca Cardelli,et al.  Compiling a functional language , 1984, LFP '84.

[17]  Alan J. Demers,et al.  Data types are values , 1985, ACM Trans. Program. Lang. Syst..

[18]  Hans-Juergen Boehm,et al.  Implementing RUSSELL , 1986, SIGPLAN '86.

[19]  Michael J. O'Donnell,et al.  Equational Logic as a Programming Language. , 1987 .