Numerical Recipes
Encyclopedia
Numerical Recipes is the generic title of a series of books on algorithm
s and numerical analysis
by William H. Press
, Saul Teukolsky
, William Vetterling and Brian Flannery. In various editions, the books have been in print since 1986. The most recent edition was published in 2007.
(interpolation
, integration
, linear algebra
, differential equations, and so on), signal processing (Fourier methods, filtering
), statistical treatment of data, and a few topics in machine learning (hidden Markov models, support vector machines). The writing style is accessible and has an informal tone. The emphasis is on understanding the underlying basics of techniques, not on the refinements that may, in practice, be needed to achieve optimal performance and reliability. Few results are proved with any degree of rigor, although the ideas behind proofs are often sketched, and references are given.
Virtually all methods that are discussed are also implemented in code, which is printed in the book.
According to the publisher, Cambridge University Press
, the Numerical Recipes books are historically the all-time best-selling books on scientific programming methods. In recent years, Numerical Recipes books have been cited in the scientific literature more than 3000 times per year according to ISI Web of Knowledge (e.g., 3962 times in the year 2008).
However, as it turned out, the 1980s were fertile years for the "black box" side, yielding important integrated environments such as MATLAB
and Mathematica
that remain standards today. By the early 1990s, when Second Edition versions of Numerical Recipes (with code in C, Fortran-77, and Fortran-90) were published, it was clear that the constituency for Numerical Recipes was by no means the majority of scientists doing computation, but only that slice that lived between the more mathematical numerical analysts and the larger community using integrated environments. The Second Edition versions occupied a stable role in this niche environment.
By the mid-2000s, the practice of scientific computing had been radically altered by the mature Internet and Web. Recognizing that their Numerical Recipes books were increasingly valued more for their explanatory text than for their code examples, the authors significantly expanded the scope of the book, and significantly rewrote a large part of the text. They continued to include code, still printed in the book, now in C++, for every method discussed. The Third Edition was also released as an electronic book, eventually made available on the Web for free (with limited page views) or by paid or institutional subscription (with unlimited page views).
however, the authors' readiness to "go out on a limb and present their own opinions". Given the editorial style of the books, it is not surprising that they were (and to some extent remain) controversial within the numerical analysis
community. Early criticism centered on the books' assumed unreliability (the First Edition indeed contained some mistakes), the exclusion of some algorithms, and the authors' implication, not always correct, that their programs were as efficient and reliable as "black-box" libraries, for example the NAG Numerical Libraries
. Although not mentioning Numerical Recipes by name, Whaley et al. demonstrate that LAPACK
with a highly optimized BLAS
library can be an order of magnitude faster (or more) than textbook-style triply nested-loop linear-algebra routines similar to the code in Numerical Recipes. As another example, Frigo and Johnson point out that the fast Fourier transform
(FFT) code in Numerical Recipes is 5–40 times slower than highly optimized programs on modern computer architectures.
A second line of criticism centers on the fact that, although printed in the books, the code is copyright by the
Numerical Recipes authors, and not free available to use under a GNU General Public License
or similar open license. Indeed, one early motivation for the GNU Scientific Library
was that a free
library was in part needed as a substitute for Numerical Recipes. The Numerical Recipes authors have been unapologetic to this criticism. They derive income from selling individual and corporate licenses to the code, and clearly consider the Numerical Recipes enterprise as a business.
A third line of criticism centers on the coding style of the books, which strike some modern readers as "Fortran-ish", even when the actual coding language is contemporary, object-oriented C++. Some of this criticism is undoubtedly true, and due to the legacy history of parts of the code. However, the authors have defended their style as necessary to the format of the books, requiring a very terse coding style because of space limitations and for readability.
The books are published by Cambridge University Press
.
Algorithm
In mathematics and computer science, an algorithm is an effective method expressed as a finite list of well-defined instructions for calculating a function. Algorithms are used for calculation, data processing, and automated reasoning...
s and numerical analysis
Numerical analysis
Numerical analysis is the study of algorithms that use numerical approximation for the problems of mathematical analysis ....
by William H. Press
William H. Press
William H. Press is an astrophysicist, theoretical physicist, and computational biologist. He is a member of the United States National Academy of Sciences, the American Academy of Arts and Sciences, and the Council on Foreign Relations. Other honors include the 1981 Helen B...
, Saul Teukolsky
Saul Teukolsky
Saul Teukolsky is a theoretical astrophysicist and a professor of Physics and Astronomy at Cornell University. His major research interests include general relativity, relativistic astrophysics, and computational astrophysics.-Biography:...
, William Vetterling and Brian Flannery. In various editions, the books have been in print since 1986. The most recent edition was published in 2007.
Overview
The Numerical Recipes books cover a range of topics that include both classical numerical analysisNumerical analysis
Numerical analysis is the study of algorithms that use numerical approximation for the problems of mathematical analysis ....
(interpolation
Interpolation
In the mathematical field of numerical analysis, interpolation is a method of constructing new data points within the range of a discrete set of known data points....
, integration
Numerical integration
In numerical analysis, numerical integration constitutes a broad family of algorithms for calculating the numerical value of a definite integral, and by extension, the term is also sometimes used to describe the numerical solution of differential equations. This article focuses on calculation of...
, linear algebra
Linear algebra
Linear algebra is a branch of mathematics that studies vector spaces, also called linear spaces, along with linear functions that input one vector and output another. Such functions are called linear maps and can be represented by matrices if a basis is given. Thus matrix theory is often...
, differential equations, and so on), signal processing (Fourier methods, filtering
Digital filter
In electronics, computer science and mathematics, a digital filter is a system that performs mathematical operations on a sampled, discrete-time signal to reduce or enhance certain aspects of that signal. This is in contrast to the other major type of electronic filter, the analog filter, which is...
), statistical treatment of data, and a few topics in machine learning (hidden Markov models, support vector machines). The writing style is accessible and has an informal tone. The emphasis is on understanding the underlying basics of techniques, not on the refinements that may, in practice, be needed to achieve optimal performance and reliability. Few results are proved with any degree of rigor, although the ideas behind proofs are often sketched, and references are given.
Virtually all methods that are discussed are also implemented in code, which is printed in the book.
According to the publisher, Cambridge University Press
Cambridge University Press
Cambridge University Press is the publishing business of the University of Cambridge. Granted letters patent by Henry VIII in 1534, it is the world's oldest publishing house, and the second largest university press in the world...
, the Numerical Recipes books are historically the all-time best-selling books on scientific programming methods. In recent years, Numerical Recipes books have been cited in the scientific literature more than 3000 times per year according to ISI Web of Knowledge (e.g., 3962 times in the year 2008).
History
First published in 1986, with code in Fortran (soon followed by editions in Pascal, BASIC, and C), Numerical Recipes took, from the start, an opinionated editorial position at odds with the conventional wisdom of the numerical analysis community:However, as it turned out, the 1980s were fertile years for the "black box" side, yielding important integrated environments such as MATLAB
MATLAB
MATLAB is a numerical computing environment and fourth-generation programming language. Developed by MathWorks, MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages,...
and Mathematica
Mathematica
Mathematica is a computational software program used in scientific, engineering, and mathematical fields and other areas of technical computing...
that remain standards today. By the early 1990s, when Second Edition versions of Numerical Recipes (with code in C, Fortran-77, and Fortran-90) were published, it was clear that the constituency for Numerical Recipes was by no means the majority of scientists doing computation, but only that slice that lived between the more mathematical numerical analysts and the larger community using integrated environments. The Second Edition versions occupied a stable role in this niche environment.
By the mid-2000s, the practice of scientific computing had been radically altered by the mature Internet and Web. Recognizing that their Numerical Recipes books were increasingly valued more for their explanatory text than for their code examples, the authors significantly expanded the scope of the book, and significantly rewrote a large part of the text. They continued to include code, still printed in the book, now in C++, for every method discussed. The Third Edition was also released as an electronic book, eventually made available on the Web for free (with limited page views) or by paid or institutional subscription (with unlimited page views).
Criticism
An early reviewer wrote, "The phrase 'numerical recipes' is bound to send the shudders down every honest numerical mathematicians spine.". He also praised,however, the authors' readiness to "go out on a limb and present their own opinions". Given the editorial style of the books, it is not surprising that they were (and to some extent remain) controversial within the numerical analysis
Numerical analysis
Numerical analysis is the study of algorithms that use numerical approximation for the problems of mathematical analysis ....
community. Early criticism centered on the books' assumed unreliability (the First Edition indeed contained some mistakes), the exclusion of some algorithms, and the authors' implication, not always correct, that their programs were as efficient and reliable as "black-box" libraries, for example the NAG Numerical Libraries
NAG Numerical Libraries
NAG Numerical Libraries is a software product sold by The Numerical Algorithms Group Ltd . The product is a software library of numerical analysis routines. It comprises a collection of 1500 mathematical and statistical algorithms. Areas covered include linear algebra, optimization, quadrature,...
. Although not mentioning Numerical Recipes by name, Whaley et al. demonstrate that LAPACK
LAPACK
-External links:* : a modern replacement for PLAPACK and ScaLAPACK* on Netlib.org* * * : a modern replacement for LAPACK that is MultiGPU ready* on Sourceforge.net* * optimized LAPACK for Solaris OS on SPARC/x86/x64 and Linux* * *...
with a highly optimized BLAS
Blas
Blas is mainly a Spanish given name and surname, related to Blaise. It may refer to-Places:*Piz Blas, mountain in Switzerland*San Blas , many places - see separate article, also**Cape San Blas Light, lighthouse...
library can be an order of magnitude faster (or more) than textbook-style triply nested-loop linear-algebra routines similar to the code in Numerical Recipes. As another example, Frigo and Johnson point out that the fast Fourier transform
Fast Fourier transform
A fast Fourier transform is an efficient algorithm to compute the discrete Fourier transform and its inverse. "The FFT has been called the most important numerical algorithm of our lifetime ." There are many distinct FFT algorithms involving a wide range of mathematics, from simple...
(FFT) code in Numerical Recipes is 5–40 times slower than highly optimized programs on modern computer architectures.
A second line of criticism centers on the fact that, although printed in the books, the code is copyright by the
Numerical Recipes authors, and not free available to use under a GNU General Public License
GNU General Public License
The GNU General Public License is the most widely used free software license, originally written by Richard Stallman for the GNU Project....
or similar open license. Indeed, one early motivation for the GNU Scientific Library
GNU Scientific Library
In computing, the GNU Scientific Library is a software library written in the C programming language for numerical calculations in applied mathematics and science...
was that a free
Free software
Free software, software libre or libre software is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with restrictions that only ensure that further recipients can also do...
library was in part needed as a substitute for Numerical Recipes. The Numerical Recipes authors have been unapologetic to this criticism. They derive income from selling individual and corporate licenses to the code, and clearly consider the Numerical Recipes enterprise as a business.
A third line of criticism centers on the coding style of the books, which strike some modern readers as "Fortran-ish", even when the actual coding language is contemporary, object-oriented C++. Some of this criticism is undoubtedly true, and due to the legacy history of parts of the code. However, the authors have defended their style as necessary to the format of the books, requiring a very terse coding style because of space limitations and for readability.
Titles in the Series (Partial List)
The books differ by edition (1st, 2nd, and 3rd) and by the computer language in which the code is given.- Numerical Recipes. The Art of Scientific Computing, 3rd Edition, 2007, ISBN 0-521-88068-8. (C++ code)
- Numerical Recipes in CC (programming language)C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....
. The Art of Scientific Computing, 2nd Edition, 1992, ISBN 0-521-43108-5. - Numerical Recipes in FortranFortranFortran is a general-purpose, procedural, imperative programming language that is especially suited to numeric computation and scientific computing...
77. The Art of Scientific Computing, 2nd Edition, 1992, ISBN 0-521-43064-X. - Numerical Recipes in Fortran 90. The Art of Parallel Scientific Computing, 2nd Edition, 1996, ISBN 0-521-57439-0.
- Numerical Recipes in Pascal. The Art of Scientific Computing, 1st Edition, 1989, ISBN 0-521-37516-9.
The books are published by Cambridge University Press
Cambridge University Press
Cambridge University Press is the publishing business of the University of Cambridge. Granted letters patent by Henry VIII in 1534, it is the world's oldest publishing house, and the second largest university press in the world...
.
External links
- Numerical Recipes web site.
- Current electronic edition of Numerical Recipes (limited free page views).
- Older versions of Numerical Recipes available electronically (links to C, Fortran 77, and Fortran 90 versions in various formats, plus other hosted books)
- Reviews of Numerical Recipes
- Norman Gray, A balanced discussion of NR and its critics
- Alternatives to Numerical Recipes