Sample page from NUMERICAL RECIPES IN FORTRAN 77: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43064-X)
Copyright (C) 1986-1992 by Cambridge University Press.Programs Copyright (C) 1986-1992 by Numerical Recipes Software.
Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copying of machine-
readable files (including this one) to any servercomputer, is strictly prohibited. To order Numerical Recipes books,diskettes, or CDROMs
visit website http://www.nr.com or call 1-800-872-7423 (North America only),or send email to trade@cup.cam.ac.uk (outside North America).
Preface to the First Edition
We call thisbook Numerical Recipes for several reasons. In one sense, thisbook
is indeed a “cookbook” on numerical computation. However there is an important
distinction between a cookbook and a restaurant menu. The latter presents choices
among complete dishes in each of which the individual flavors are blended and
disguised. The former — and this book — reveals the individual ingredients and
explains how they are prepared and combined.
Another purpose of the title is to connote an eclectic mixture of presentational
techniques. This book is unique, we think, in offering, for each topic considered,
a certain amount of general discussion, a certain amount of analytical mathematics,
a certain amount of discussion of algorithmics, and (most important) actual imple-
mentations of these ideas in the form of working computer routines. Our task has
been to find the right balance among these ingredients for each topic. You will
find that for some topics we have tilted quite far to the analytic side; this where we
have felt there to be gaps in the “standard” mathematical training. For other topics,
where the mathematical prerequisites are universally held, we have tilted towards
more in-depth discussion of the nature of the computational algorithms, or towards
practical questions of implementation.
We admit, therefore, to some unevenness in the “level” of this book. About half
of it is suitable for an advanced undergraduate course on numerical computation for
science or engineering majors. The other half ranges from the level of a graduate
course to that of a professional reference. Most cookbooks have, after all, recipes at
varying levels of complexity. An attractive feature of thisapproach, we think, is that
the reader can use the book at increasinglevels of sophisticationas his/her experience
grows. Even inexperienced readers should be able to use our most advanced routines
as black boxes. Having done so, we hope that these readers will subsequently go
back and learn what secrets are inside.
If there is a single dominant theme in this book, it is that practical methods
of numerical computation can be simultaneously efficient, clever, and — important
— clear. The alternative viewpoint, that efficient computational methods must
necessarily be so arcane and complex as to be useful only in “black box” form,
we firmly reject.
Our purpose in this book is thus to open up a large number of computational
black boxes to your scrutiny. We want to teach you to take apart these black boxes
and to put them back together again, modifying them to suit your specific needs.
We assume that you are mathematically literate, i.e., that you have the normal
mathematical preparation associated with an undergraduate degree in a physical
science, or engineering, or economics, or a quantitative social science. We assume
that you know how to program a computer. We do not assume that you have any
prior formal knowledge of numerical analysis or numerical methods.
The scope of Numerical Recipes is supposed to be “everything up to, but
not including, partial differential equations.” We honor this in the breach: First,
we do have one introductory chapter on methods for partial differential equations
(Chapter 19). Second, we obviouslycannot includeeverything else. All the so-called
“standard” topics of a numerical analysis course have been included in this book:
xviii