## Fast Floating-Point Processing in Common Lisp (1995)

Venue: | ACM Trans. on Math. Software |

Citations: | 5 - 1 self |

### BibTeX

@ARTICLE{Fateman95fastfloating-point,

author = {Richard J. Fateman and Kevin A. Broughan and Diane K. Willcock and Duane Rettig and Franz Inc},

title = {Fast Floating-Point Processing in Common Lisp},

journal = {ACM Trans. on Math. Software},

year = {1995},

volume = {21},

pages = {26--62}

}

### OpenURL

### Abstract

this paper we explore an approach which enables all of the problems listed above to be solved at a single stroke: use Lisp as the source language for the numeric and graphical code! This is not a new idea --- it was tried at MIT and UCB in the 1970's. While these experiments were modestly successful, the particular systems are obsolete. Fortunately, some of those ideas used in Maclisp [37], NIL [38] and Franz Lisp [20] were incorporated in the subsequent standardization of Common Lisp (CL) [35]. In this new setting it is appropriate to re-examine the theoretical and practical implications of writing numeric code in Lisp. The popular conceptions of Lisp's inefficiency for numerics have been based on rumor, supposition, and experience with early and (in fact) inefficient implementations. It is certainly possible to continue to write inefficient programs: As one example of the results of de-emphasizing numerics in the design, consider the situation of the basic arithmetic operators. The definitions of these functions require that they are generic, (e.g. "+" must be able to add any combination of several precisions of floats, arbitrary-precision integers, rational numbers, and complexes), The very simple way of implementing this arithmetic -- by subroutine calls -- is also very inefficient. Even with appropriate declarations to enable more specific treatment of numeric types, compilers are free to ignore declarations and such implementations naturally do not accommodate the needs of intensive number-crunching. (See the appendix for further discussion of declarations). Be this as it may, the situation with respect to Lisp has changed for the better in recent years. With the advent of ANSI standard Common Lisp, several active vendors of implementations and one active universi...

### Citations

2423 |
The art of computer programming
- Knuth
- 2005
(Show Context)
Citation Context ...atively low degree) polynomials. As one example, if you have two independent units to evaluate polynomials, decomposing p(x) into p 1 (x 2 )+x \Delta p 0 (x 2 ) may save about half the computing time =-=[24]-=- --- if you are just counting multiplications and additions. In an environment devoted to generating and making available top-quality software, implementation of alternative ideas like poly-eval or st... |

588 |
Basic Linear Algebra Subprograms for FORTRAN Usage
- Lawson, Hanson, et al.
- 1979
(Show Context)
Citation Context ...atically handle the Fortran entry statement, used only once in Numerical Recipes, and in the NAG Library only in Chapter F06 devoted to NAG's implementation of the Basic Linear Algebra Routines (BLAS =-=[26]-=-), where the essentially trivial use of the statement is to set up aliases for subroutines names: F06AAF and DROTG for example, where the latter is the original BLAS name. Although the translator does... |

95 |
The Design and Analysis of Computer Algorithms (Addison-Wesley
- Aho, Hopcroft, et al.
- 1974
(Show Context)
Citation Context ... from a "Fortran-in-Lisp" notation to a "Normal Lisp" notation. In a 2-dimensional array of size m by n, using Lisp's zero-based array, the entries are laid out in memory in row-ma=-=jor order: a[0,0], a[0, 1], ..., a[0-=-,n-1], a[1,0], a[1, 1], ..., a[1,n-1], ... a[m-1,0] , ..., a[m-1,n-1] So if r is the address of a[0; 0], and the "stride" of the array is s (for example 8 bytes if the array holds double-flo... |

45 |
GAMS: A Framework for the Management of Scientific Software
- Boisvert, Howe, et al.
- 1985
(Show Context)
Citation Context ...he principle reason for writing f2cl is to demonstrate that with reasonable ease we can make effective use of algorithmic content of the large body of existing numeric code, mostly written in Fortran =-=[6]-=-, within Lisp-based environments. This should weaken one argument in favor of continuing to use Fortran, regardless of its suitability for new code, that there is too high a value in the large body of... |

39 | CAS/PI: A Portable and extensible interface for computer algebra systems
- Kajler
- 1992
(Show Context)
Citation Context ...routines which are then fit into templates of other Fortran code to produce complete packages. Some recent work includes work by Wirth [39], Lanam [25], Wang [36], Broughan [7], Cook [19], and Kajler =-=[23]-=-). As a principal example of the approach of linking Lisp programs with numerics, consider the development of symbolic-numeric algorithms for the Senac environment, under way at the University of Waik... |

28 |
Finite Element Analysis
- Burnett
- 1988
(Show Context)
Citation Context ...med common blocks. Numerical Recipes has about 10. We have come across code where common blocks are used uniformly to pass data between subroutines, bypassing the normal, safer mechanism (e.g. UNAFEM =-=[17]-=-). The cases where named common blocks are used with different substructure and names within different subprograms are, in our experience, quite rare. As indicated in section 2 above, lexical closures... |

28 |
The design of XMP linear programming library
- Marsten
- 1981
(Show Context)
Citation Context ...sed Fortran structure is the equivalence statement. This construction is used about 50 times in the NAG Library and once in Numerical Recipes. Some programs use the statement in an essential way (XMP =-=[31]-=- for example). The Common Lisp displaced-array enables these to be modeled effectively, although we have not chosen to automate this feature. Although Common Lisp has an elaborate set of formatting fe... |

27 |
Private communication
- Stanley
- 2008
(Show Context)
Citation Context ...al effort to tune the program to the memory characteristics of the architecture and its implementation. The final column is the time (estimated) taken by a highly tuned program written by Ken Stanley =-=[34]-=- using a combination of C and assembler. This program is based on partitioning the arrays into 2 \Theta 3 submatrices and multiplying these blocks. This is rather elaborate, but worth it if matrix mul... |

26 |
FINGER: a symbolic system for automatic generation of numerical programs in finite element analysis
- Wang
- 1986
(Show Context)
Citation Context ... symbolic systems to help code Fortran subroutines which are then fit into templates of other Fortran code to produce complete packages. Some recent work includes work by Wirth [39], Lanam [25], Wang =-=[36]-=-, Broughan [7], Cook [19], and Kajler [23]). As a principal example of the approach of linking Lisp programs with numerics, consider the development of symbolic-numeric algorithms for the Senac enviro... |

12 |
The python compiler for cmu common lisp
- MacLachlan
- 1992
(Show Context)
Citation Context ...)))) ;; etc ... )) where each of the apparently identical "arms" of the typecase are compiled quite differently because the type of z differs in each case. In the case of in-line expansion t=-=he CMU-CL [32]-=- compiler can, given appropriate declarations, remove the type check as well as the dead code from the unused arms of the typecase.(See the appendix for further discussion). 3. MOTIVATION FOR NUMERICA... |

9 | Children in perspective
- White
- 1979
(Show Context)
Citation Context ...w idea --- it was tried at MIT and UCB in the 1970's. While these experiments were modestly successful, the particular systems are obsolete. Fortunately, some of those ideas used in Maclisp [37], NIL =-=[38]-=- and Franz Lisp [20] were incorporated in the subsequent standardization of Common Lisp (CL) [35]. In this new setting it is appropriate to re-examine the theoretical and practical implications of wri... |

8 | Numlink and Naglink: links to the NAG library from
- Broughan, Keady
- 1991
(Show Context)
Citation Context ... foreign-function linkage. Using both of these methods, the Waikato group has written a number of interfaces. Naglink: [13, 14, 15] was written between Macsyma [28] and the NAG Library [22]; Numlink: =-=[8, 10, 11, 12]-=- between Senac and Graflink [7] and the NAG Fortran Library and Graphics Library. These references describe how components have been integrated to provide a very highly automated problem-solving envir... |

8 |
Code Generation in ALPAL Using Symbolic Techniques
- Cook
- 1992
(Show Context)
Citation Context ... code Fortran subroutines which are then fit into templates of other Fortran code to produce complete packages. Some recent work includes work by Wirth [39], Lanam [25], Wang [36], Broughan [7], Cook =-=[19]-=-, and Kajler [23]). As a principal example of the approach of linking Lisp programs with numerics, consider the development of symbolic-numeric algorithms for the Senac environment, under way at the U... |

6 |
Naglink - a working symbolic/numeric interface
- Broughan
- 1987
(Show Context)
Citation Context ...the IPC technique is even less likely to be robust in the face of errors than the foreign-function linkage. Using both of these methods, the Waikato group has written a number of interfaces. Naglink: =-=[13, 14, 15]-=- was written between Macsyma [28] and the NAG Library [22]; Numlink: [8, 10, 11, 12] between Senac and Graflink [7] and the NAG Fortran Library and Graphics Library. These references describe how comp... |

6 |
On the Automation of Computational Physics
- Wirth
- 1980
(Show Context)
Citation Context ...built around the use of symbolic systems to help code Fortran subroutines which are then fit into templates of other Fortran code to produce complete packages. Some recent work includes work by Wirth =-=[39]-=-, Lanam [25], Wang [36], Broughan [7], Cook [19], and Kajler [23]). As a principal example of the approach of linking Lisp programs with numerics, consider the development of symbolic-numeric algorith... |

5 |
Interactive Access to subroutine libraries: an interlink for SENAC
- Broughan
- 1990
(Show Context)
Citation Context ... foreign-function linkage. Using both of these methods, the Waikato group has written a number of interfaces. Naglink: [13, 14, 15] was written between Macsyma [28] and the NAG Library [22]; Numlink: =-=[8, 10, 11, 12]-=- between Senac and Graflink [7] and the NAG Fortran Library and Graphics Library. These references describe how components have been integrated to provide a very highly automated problem-solving envir... |

5 |
SENAC: Lisp as a platform for constructing a problem solving environment
- Broughan
- 1992
(Show Context)
Citation Context ... foreign-function linkage. Using both of these methods, the Waikato group has written a number of interfaces. Naglink: [13, 14, 15] was written between Macsyma [28] and the NAG Library [22]; Numlink: =-=[8, 10, 11, 12]-=- between Senac and Graflink [7] and the NAG Fortran Library and Graphics Library. These references describe how components have been integrated to provide a very highly automated problem-solving envir... |

5 |
Transportable Numerical Software
- FORD
- 1982
(Show Context)
Citation Context ...errors than the foreign-function linkage. Using both of these methods, the Waikato group has written a number of interfaces. Naglink: [13, 14, 15] was written between Macsyma [28] and the NAG Library =-=[22]-=-; Numlink: [8, 10, 11, 12] between Senac and Graflink [7] and the NAG Fortran Library and Graphics Library. These references describe how components have been integrated to provide a very highly autom... |

5 |
Stable Evaluation of Polynomials
- Meszteny, Witzgall
- 1967
(Show Context)
Citation Context ...here are other choices for pre-conditioning coefficients with different properties. There are alternative techniques known to evaluate a polynomial with "optimal" accuracy (e.g. Meszteny and=-= Witsgall [30]-=-), involving a kind of Taylorseries expansion of the polynomial about a zero near the interval of interest. While the preconditioned formula appears in fact to be faster on our Sun Microsystems Sparc ... |

4 |
An algebraic front-end for the production and use of numeric programs.” ISSAC’83. Snowbird Utah
- Lanam
(Show Context)
Citation Context ... the use of symbolic systems to help code Fortran subroutines which are then fit into templates of other Fortran code to produce complete packages. Some recent work includes work by Wirth [39], Lanam =-=[25]-=-, Wang [36], Broughan [7], Cook [19], and Kajler [23]). As a principal example of the approach of linking Lisp programs with numerics, consider the development of symbolic-numeric algorithms for the S... |

2 |
LAPACK Users' Guide, Release
- Anderson, Bai, et al.
(Show Context)
Citation Context ...next section). An important point we wish to emphasize is the use of higher level targets -- like the poly-eval macro illustrated earlier, a scalar-product array primitive (see below), or canned BLAS =-=[4]-=- which form the core building blocks for portable high-speed reliable linear algebra programs. By appropriately re-defining the BLAS in machine-dependent fashion, a large percentage of the vector and ... |

2 |
The Nimble Type Inferencer for Common Lisp-84" Nimble Computer
- Baker
- 1990
(Show Context)
Citation Context ...mplexity of the Common Lisp library functions is mostly gratuitous, and both the efficiency of compiled code and the efficiency of the programmer could be increased by rationalizing this complexity.&q=-=uot; [5]-=- For example the type of the result of the some functions (e.g. sqrt or log) cannot be computed based solely on the type of argument. One must know something about the value: a negative argument to sq... |

2 |
The SENAC
- Broughan
- 1990
(Show Context)
Citation Context ...ms to help code Fortran subroutines which are then fit into templates of other Fortran code to produce complete packages. Some recent work includes work by Wirth [39], Lanam [25], Wang [36], Broughan =-=[7]-=-, Cook [19], and Kajler [23]). As a principal example of the approach of linking Lisp programs with numerics, consider the development of symbolic-numeric algorithms for the Senac environment, under w... |

2 |
SENAC: a high level interface for the NAG
- Broughan
- 1991
(Show Context)
Citation Context |

2 |
The Naglink Manual -- An interface between
- Broughan
(Show Context)
Citation Context ...the IPC technique is even less likely to be robust in the face of errors than the foreign-function linkage. Using both of these methods, the Waikato group has written a number of interfaces. Naglink: =-=[13, 14, 15]-=- was written between Macsyma [28] and the NAG Library [22]; Numlink: [8, 10, 11, 12] between Senac and Graflink [7] and the NAG Fortran Library and Graphics Library. These references describe how comp... |

2 |
A symbolic numeric interface for the NAG
- Broughan
- 1986
(Show Context)
Citation Context ...the IPC technique is even less likely to be robust in the face of errors than the foreign-function linkage. Using both of these methods, the Waikato group has written a number of interfaces. Naglink: =-=[13, 14, 15]-=- was written between Macsyma [28] and the NAG Library [22]; Numlink: [8, 10, 11, 12] between Senac and Graflink [7] and the NAG Fortran Library and Graphics Library. These references describe how comp... |

2 | The Risch algorithms of Macsyma and - Schou, Broughan - 1989 |

2 |
Lisp: Program is Data: A historical perspective on
- White
- 1977
(Show Context)
Citation Context ...s not a new idea --- it was tried at MIT and UCB in the 1970's. While these experiments were modestly successful, the particular systems are obsolete. Fortunately, some of those ideas used in Maclisp =-=[37]-=-, NIL [38] and Franz Lisp [20] were incorporated in the subsequent standardization of Common Lisp (CL) [35]. In this new setting it is appropriate to re-examine the theoretical and practical implicati... |

1 |
Personal Communication 8
- Feldman
- 1993
(Show Context)
Citation Context ...p. Ironically, Lisp is an especially well-suited language for developing and specifying such tools: an intermediate form for a Fortran program as it is compiled is likely to look very much like Lisp! =-=[18]-=- [2]. Loop optimizations, unrolling, and other transformations can often be expressed nicely in Lisp, subject to a reasonable underlying model of the architecture (knowing how far to unroll a loop, or... |

1 |
Foderaro (editor), Special Section on Lisp
- K
- 1991
(Show Context)
Citation Context ...ATEMAN University of California, Berkeley and KEVIN A. BROUGHAN and DIANE K. WILLCOCK University of Waikato and DUANE RETTIG Franz Inc. Lisp, one of the oldest higher-level programming languages [29] =-=[21]-=- has rarely been used for fast numerical (floating-point) computation. We explore the benefits of Common Lisp [35], an emerging new language standard with some excellent implementations, for numerical... |

1 | Fateman et al - \Delta |