Numerical Recipes in Fortran
Acrobat ® Edition
Thanks to special permission from Cambridge University Press, we are able to bring you the complete
Numerical Recipes in Fortran 77 book On-Line! To utilize this resource, you will need an Adobe
Acrobat viewer linked as a helper program to your web browser. Permission is granted by the copyright
owners for users of this resource to make one paper copy of these Acrobat files for their own personal
use. Further reproduction, or the extraction of, or copying of, machine readable files to any server
computer, is strictly prohibited. This on-line resource is not intended as a substitute for purchasing the
book.
Access Numerical Recipes Source Files (Free for
Cornell Community Only)
Click on image to the left.
● Front Matter, Contents, and Prefaces xi
● Legal Matters xvi
● Computer Programs by Chapter and Section xix
1 Preliminaries
● 1.0 Introduction 1
● 1.1 Program Organization and Control Structures 5
● 1.2 Error, Accuracy, and Stability 18
file:///E|/income/2006.06.26/internet/www.library.cornell.edu/nr/cbookfpdf.html (1 of 9)13.07.2006 16:21:05
,Numerical Recipes in Fortran
2 Solution of Linear Algebraic Equations
● 2.0 Introduction 22
● 2.1 Gauss-Jordan Elimination 27
● 2.2 Gaussian Elimination with Backsubstitution 33
● 2.3 LU Decomposition and Its Applications 34
● 2.4 Tridiagonal and Band Diagonal Systems of Equations 42
● 2.5 Iterative Improvement of a Solution to Linear Equations 47
● 2.6 Singular Value Decomposition 51
● 2.7 Sparse Linear Systems 63
● 2.8 Vandermonde Matrices and Toeplitz Matrices 82
● 2.9 Cholesky Decomposition 89
● 2.10 QR Decomposition 91
● 2.11 Is Matrix Inversion an $N^3$ Process? 95
3 Interpolation and Extrapolation
● 3.0 Introduction 99
● 3.1 Polynomial Interpolation and Extrapolation 102
● 3.2 Rational Function Interpolation and Extrapolation 104
● 3.3 Cubic Spline Interpolation 107
● 3.4 How to Search an Ordered Table 110
● 3.5 Coefficients of the Interpolating Polynomial 113
● 3.6 Interpolation in Two or More Dimensions 116
4 Integration of Functions
● 4.0 Introduction 123
● 4.1 Classical Formulas for Equally Spaced Abscissas 124
● 4.2 Elementary Algorithms 130
file:///E|/income/2006.06.26/internet/www.library.cornell.edu/nr/cbookfpdf.html (2 of 9)13.07.2006 16:21:05
,Numerical Recipes in Fortran
● 4.3 Romberg Integration 134
● 4.4 Improper Integrals 135
● 4.5 Gaussian Quadratures and Orthogonal Polynomials 140
● 4.6 Multidimensional Integrals 155
5 Evaluation of Functions
● 5.0 Introduction 159
● 5.1 Series and Their Convergence 159
● 5.2 Evaluation of Continued Fractions 163
● 5.3 Polynomials and Rational Functions 167
● 5.4 Complex Arithmetic 171
● 5.5 Recurrence Relations and Clenshaw's Recurrence Formula 172
● 5.6 Quadratic and Cubic Equations 178
● 5.7 Numerical Derivatives 180
● 5.8 Chebyshev Approximation 184
● 5.9 Derivatives or Integrals of a Chebyshev-approximated Function 189
● 5.10 Polynomial Approximation from Chebyshev Coefficients 191
● 5.11 Economization of Power Series 192
● 5.12 Pad\'e Approximants 194
● 5.13 Rational Chebyshev Approximation 197
● 5.14 Evaluation of Functions by Path Integration 201
6 Special Functions
● 6.0 Introduction 205
● 6.1 Gamma Function, Beta Function, Factorials, Binomial Coefficients 206
● 6.2 Incomplete Gamma Function, Error Function, Chi-Square Probability Function,
Cumulative Poisson Function 209
● 6.3 Exponential Integrals 215
file:///E|/income/2006.06.26/internet/www.library.cornell.edu/nr/cbookfpdf.html (3 of 9)13.07.2006 16:21:05
, Numerical Recipes in Fortran
● 6.4 Incomplete Beta Function, Student's Distribution, F-Distribution,Cumulative Binomial
Distribution 219
● 6.5 Bessel Functions of Integer Order 223
● 6.6 Modified Bessel Functions of Integer Order 229
● 6.7 Bessel Functions of Fractional Order, Airy Functions, SphericalBessel Functions 234
● 6.8 Spherical Harmonics 246
● 6.9 Fresnel Integrals, Cosine and Sine Integrals 248
● 6.10 Dawson's Integral 252
● 6.11 Elliptic Integrals and Jacobian Elliptic Functions 254
● 6.12 Hypergeometric Functions 263
7 Random Numbers
● 7.0 Introduction 266
● 7.1 Uniform Deviates 267
● 7.2 Transformation Method: Exponential and Normal Deviates 277
● 7.3 Rejection Method: Gamma, Poisson, Binomial Deviates 281
● 7.4 Generation of Random Bits 287
● 7.5 Random Sequences Based on Data Encryption 290
● 7.6 Simple Monte Carlo Integration 295
● 7.7 Quasi- (that is, Sub-) Random Sequences 299
● 7.8 Adaptive and Recursive Monte Carlo Methods 306
8 Sorting
● 8.0 Introduction 320
● 8.1 Straight Insertion and Shell's Method 321
● 8.2 Quicksort 323
● 8.3 Heapsort 327
● 8.4 Indexing and Ranking 329
file:///E|/income/2006.06.26/internet/www.library.cornell.edu/nr/cbookfpdf.html (4 of 9)13.07.2006 16:21:05
Acrobat ® Edition
Thanks to special permission from Cambridge University Press, we are able to bring you the complete
Numerical Recipes in Fortran 77 book On-Line! To utilize this resource, you will need an Adobe
Acrobat viewer linked as a helper program to your web browser. Permission is granted by the copyright
owners for users of this resource to make one paper copy of these Acrobat files for their own personal
use. Further reproduction, or the extraction of, or copying of, machine readable files to any server
computer, is strictly prohibited. This on-line resource is not intended as a substitute for purchasing the
book.
Access Numerical Recipes Source Files (Free for
Cornell Community Only)
Click on image to the left.
● Front Matter, Contents, and Prefaces xi
● Legal Matters xvi
● Computer Programs by Chapter and Section xix
1 Preliminaries
● 1.0 Introduction 1
● 1.1 Program Organization and Control Structures 5
● 1.2 Error, Accuracy, and Stability 18
file:///E|/income/2006.06.26/internet/www.library.cornell.edu/nr/cbookfpdf.html (1 of 9)13.07.2006 16:21:05
,Numerical Recipes in Fortran
2 Solution of Linear Algebraic Equations
● 2.0 Introduction 22
● 2.1 Gauss-Jordan Elimination 27
● 2.2 Gaussian Elimination with Backsubstitution 33
● 2.3 LU Decomposition and Its Applications 34
● 2.4 Tridiagonal and Band Diagonal Systems of Equations 42
● 2.5 Iterative Improvement of a Solution to Linear Equations 47
● 2.6 Singular Value Decomposition 51
● 2.7 Sparse Linear Systems 63
● 2.8 Vandermonde Matrices and Toeplitz Matrices 82
● 2.9 Cholesky Decomposition 89
● 2.10 QR Decomposition 91
● 2.11 Is Matrix Inversion an $N^3$ Process? 95
3 Interpolation and Extrapolation
● 3.0 Introduction 99
● 3.1 Polynomial Interpolation and Extrapolation 102
● 3.2 Rational Function Interpolation and Extrapolation 104
● 3.3 Cubic Spline Interpolation 107
● 3.4 How to Search an Ordered Table 110
● 3.5 Coefficients of the Interpolating Polynomial 113
● 3.6 Interpolation in Two or More Dimensions 116
4 Integration of Functions
● 4.0 Introduction 123
● 4.1 Classical Formulas for Equally Spaced Abscissas 124
● 4.2 Elementary Algorithms 130
file:///E|/income/2006.06.26/internet/www.library.cornell.edu/nr/cbookfpdf.html (2 of 9)13.07.2006 16:21:05
,Numerical Recipes in Fortran
● 4.3 Romberg Integration 134
● 4.4 Improper Integrals 135
● 4.5 Gaussian Quadratures and Orthogonal Polynomials 140
● 4.6 Multidimensional Integrals 155
5 Evaluation of Functions
● 5.0 Introduction 159
● 5.1 Series and Their Convergence 159
● 5.2 Evaluation of Continued Fractions 163
● 5.3 Polynomials and Rational Functions 167
● 5.4 Complex Arithmetic 171
● 5.5 Recurrence Relations and Clenshaw's Recurrence Formula 172
● 5.6 Quadratic and Cubic Equations 178
● 5.7 Numerical Derivatives 180
● 5.8 Chebyshev Approximation 184
● 5.9 Derivatives or Integrals of a Chebyshev-approximated Function 189
● 5.10 Polynomial Approximation from Chebyshev Coefficients 191
● 5.11 Economization of Power Series 192
● 5.12 Pad\'e Approximants 194
● 5.13 Rational Chebyshev Approximation 197
● 5.14 Evaluation of Functions by Path Integration 201
6 Special Functions
● 6.0 Introduction 205
● 6.1 Gamma Function, Beta Function, Factorials, Binomial Coefficients 206
● 6.2 Incomplete Gamma Function, Error Function, Chi-Square Probability Function,
Cumulative Poisson Function 209
● 6.3 Exponential Integrals 215
file:///E|/income/2006.06.26/internet/www.library.cornell.edu/nr/cbookfpdf.html (3 of 9)13.07.2006 16:21:05
, Numerical Recipes in Fortran
● 6.4 Incomplete Beta Function, Student's Distribution, F-Distribution,Cumulative Binomial
Distribution 219
● 6.5 Bessel Functions of Integer Order 223
● 6.6 Modified Bessel Functions of Integer Order 229
● 6.7 Bessel Functions of Fractional Order, Airy Functions, SphericalBessel Functions 234
● 6.8 Spherical Harmonics 246
● 6.9 Fresnel Integrals, Cosine and Sine Integrals 248
● 6.10 Dawson's Integral 252
● 6.11 Elliptic Integrals and Jacobian Elliptic Functions 254
● 6.12 Hypergeometric Functions 263
7 Random Numbers
● 7.0 Introduction 266
● 7.1 Uniform Deviates 267
● 7.2 Transformation Method: Exponential and Normal Deviates 277
● 7.3 Rejection Method: Gamma, Poisson, Binomial Deviates 281
● 7.4 Generation of Random Bits 287
● 7.5 Random Sequences Based on Data Encryption 290
● 7.6 Simple Monte Carlo Integration 295
● 7.7 Quasi- (that is, Sub-) Random Sequences 299
● 7.8 Adaptive and Recursive Monte Carlo Methods 306
8 Sorting
● 8.0 Introduction 320
● 8.1 Straight Insertion and Shell's Method 321
● 8.2 Quicksort 323
● 8.3 Heapsort 327
● 8.4 Indexing and Ranking 329
file:///E|/income/2006.06.26/internet/www.library.cornell.edu/nr/cbookfpdf.html (4 of 9)13.07.2006 16:21:05