1 \input texinfo @c -*-texinfo-*-
2 @c This will be for the printing version of the manual
3 @c @input config-local.texi
5 @setfilename gsl-ref.info
6 @settitle GNU Scientific Library -- Reference Manual
10 @setchapternewpage odd
14 @dircategory Scientific software
16 * gsl-ref: (gsl-ref). GNU Scientific Library -- Reference
19 @c How to use the math macros
20 @c ==========================
22 @c For simple expressions, simply use the @math{} command, e.g.
24 @c @math{\exp(x)/(1+x^2)}
26 @c but if the expression includes characters that need to be 'escaped'
27 @c in texinfo, like '{' or '}', or needs different output for TeX and info,
28 @c then use the following form,
30 @c blah blah blah @c{$y^{1+b} \le \pi$}
31 @c @math{y^@{1+b@} <= \pi}
33 @c The first part using @c{} must appear at the end of a line (it reads
34 @c up to the line end -- as far as texinfo is concerned it's actually
35 @c a 'comment'). The comment command @c has been modified to capture
36 @c a TeX expression which is output by the next @math.
38 @c For ordinary comments use the @comment command.
41 % Mathematical macros taken from the GNU Calc Manual
42 % ==================================================
44 % Some special kludges to make TeX formatting prettier.
45 % Because makeinfo.c exists, we can't just define new commands.
46 % So instead, we take over little-used existing commands.
48 % Redefine @cite{text} to act like $text$ in regular TeX.
49 % Info will typeset this same as @samp{text}.
50 \gdef\goodtex{\tex \let\rm\goodrm \let\t\ttfont \turnoffactive}
51 \gdef\goodrm{\fam0\tenrm}
52 \gdef\math{\goodtex$\mathxxx}
53 \gdef\mathxxx#1{#1$\endgroup}
54 \global\let\oldxrefX=\xrefX
55 \gdef\xrefX[#1]{\begingroup\let\math=\dfn\oldxrefX[#1]\endgroup}
57 % Redefine @i{text} to be equivalent to @cite{text}, i.e., to use math mode.
58 % This looks the same in TeX but omits the surrounding ` ' in Info.
60 %\global\let\math=\cite
62 % Redefine @c{tex-stuff} \n @whatever{info-stuff}.
63 \gdef\c{\futurelet\next\mycxxx}
65 \ifx\next\bgroup \goodtex\let\next\mycxxy
66 \else\ifx\next\mindex \let\next\relax
67 \else\ifx\next\kindex \let\next\relax
68 \else\ifx\next\starindex \let\next\relax \else \let\next\comment
71 \gdef\mycxxy#1#2{#1\endgroup\mycxxz}
74 % Define \Hat to take over from \hat as an accent
75 \gdef\Hat{\mathaccent "705E}
77 %\gdef\beforedisplay{\vskip-10pt}
78 %\gdef\afterdisplay{\vskip-5pt}
82 \abovedisplayskip=7pt plus 2pt minus 1pt
83 \belowdisplayskip=7pt plus 2pt minus 1pt
84 \abovedisplayshortskip=7pt plus 2pt minus 1pt
85 \belowdisplayshortskip=7pt plus 2pt minus 1pt}
86 %\abovedisplayskip=12pt plus 3pt minus 3pt
87 %\belowdisplayskip=12pt plus 3pt minus 3pt
88 %\abovedisplayshortskip=7pt plus 1pt minus 1pt
89 %\belowdisplayshortskip=7pt plus 1pt minus 1pt
90 %\gdef\beforedisplayh{\vskip-25pt}
91 %\gdef\afterdisplayh{\vskip-10pt}
93 \gdef\arcsec{\hbox{\rm arcsec}}
94 \gdef\arccsc{\hbox{\rm arccsc}}
95 \gdef\arccot{\hbox{\rm arccot}}
96 \gdef\sech{\hbox{\rm sech}}
97 \gdef\csch{\hbox{\rm csch}}
98 \gdef\coth{\hbox{\rm coth}}
99 \gdef\arcsinh{\hbox{\rm arcsinh}}
100 \gdef\arccosh{\hbox{\rm arccosh}}
101 \gdef\arctanh{\hbox{\rm arctanh}}
102 \gdef\arcsech{\hbox{\rm arcsech}}
103 \gdef\arccsch{\hbox{\rm arccsch}}
104 \gdef\arccoth{\hbox{\rm arccoth}}
106 \gdef\Re{\hbox{\rm Re}}
107 \gdef\Im{\hbox{\rm Im}}
108 \gdef\Sin{\hbox{\rm Sin}}
109 \gdef\Cos{\hbox{\rm Cos}}
110 \gdef\Log{\hbox{\rm Log}}
112 \gdef\erf{\hbox{\rm erf}}
113 \gdef\erfc{\hbox{\rm erfc}}
114 \gdef\sinc{\hbox{\rm sinc}}
115 \gdef\sgn{\hbox{\rm sgn}}
116 \gdef\sign{\hbox{\rm sign}}
117 \gdef\det{\hbox{\rm det}}
118 \gdef\Var{\hbox{\rm Var}}
119 \gdef\arg{\hbox{\rm arg}} % avoid temporary clobbering of arg in texinfo-4.8
123 An inline version of this function is used when @code{HAVE_INLINE} is defined.
127 Inline versions of these functions are used when @code{HAVE_INLINE} is defined.
130 @include version-ref.texi
131 @set GSL @i{GNU Scientific Library}
134 Copyright @copyright{} 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 The GSL Team.
136 Permission is granted to copy, distribute and/or modify this document
137 under the terms of the GNU Free Documentation License, Version 1.2 or
138 any later version published by the Free Software Foundation; with the
139 Invariant Sections being ``GNU General Public License'' and ``Free Software
140 Needs Free Documentation'', the Front-Cover text being ``A GNU Manual'',
141 and with the Back-Cover Text being (a) (see below). A copy of the
142 license is included in the section entitled ``GNU Free Documentation
145 (a) The Back-Cover Text is: ``You have the freedom to copy and modify this
150 @title GNU Scientific Library
151 @subtitle Reference Manual
152 @subtitle Edition @value{EDITION}, for GSL Version @value{VERSION}
153 @subtitle @value{UPDATED}
156 Los Alamos National Laboratory
157 @comment @email{rosalia@@lanl.gov}
161 Department of Computer Science, Georgia Institute of Technology
162 @comment @email{jimmyd@@nis.lanl.gov}
165 @author James Theiler
166 Astrophysics and Radiation Measurements Group, Los Alamos National Laboratory
167 @comment @email{jt@@nis.lanl.gov}
171 Network Theory Limited
172 @comment @email{bjg@@network-theory.co.uk}
175 @comment Asked to be moved to 'contributors' appendix
176 @comment @author Reid Priedhorsky
177 @comment Mathematical Modeling and Analysis Group, Los Alamos National Laboratory
178 @comment @email{rp@@lanl.gov}
181 @author Gerard Jungman
182 Theoretical Astrophysics Group, Los Alamos National Laboratory
183 @comment @email{jungman@@lanl.gov}
186 @author Michael Booth
187 Department of Physics and Astronomy, The Johns Hopkins University
188 @comment @email{booth@@planck.pha.jhu.edu} or @email{booth@@debian.org}
191 @author Fabrice Rossi
192 University of Paris-Dauphine
193 @comment @email{rossi@@ufrmd.dauphine.fr}
196 @vskip 0pt plus 1filll
199 Printed copies of this manual can be purchased from Network Theory Ltd
200 at @uref{http://www.network-theory.co.uk/gsl/manual/}.
202 The money raised from sales of the manual helps support the
214 @node Top, Introduction, (dir), (dir)
217 This file documents the @value{GSL} (GSL), a collection of numerical
218 routines for scientific computing. It corresponds to release
219 @value{VERSION} of the library. Please report any errors in this
220 manual to @email{bug-gsl@@gnu.org}.
222 More information about GSL can be found at the project homepage,
223 @uref{http://www.gnu.org/software/gsl/}.
225 Printed copies of this manual can be purchased from Network Theory Ltd
226 at @uref{http://www.network-theory.co.uk/gsl/manual/}. The money
227 raised from sales of the manual helps support the development of GSL.
229 A Japanese translation of this manual is available from the GSL
230 project homepage thanks to Daisuke Tominaga.
238 * Using the library::
240 * Mathematical Functions::
243 * Special Functions::
244 * Vectors and Matrices::
251 * Fast Fourier Transforms::
252 * Numerical Integration::
253 * Random Number Generation::
254 * Quasi-Random Sequences::
255 * Random Number Distributions::
259 * Monte Carlo Integration::
260 * Simulated Annealing::
261 * Ordinary Differential Equations::
263 * Numerical Differentiation::
264 * Chebyshev Approximations::
265 * Series Acceleration::
266 * Wavelet Transforms::
267 * Discrete Hankel Transforms::
268 * One dimensional Root-Finding::
269 * One dimensional Minimization::
270 * Multidimensional Root-Finding::
271 * Multidimensional Minimization::
272 * Least-Squares Fitting::
273 * Nonlinear Least-Squares Fitting::
275 * Physical Constants::
276 * IEEE floating-point arithmetic::
277 * Debugging Numerical Programs::
278 * Contributors to GSL::
280 * GSL CBLAS Library::
281 * Free Software Needs Free Documentation::
282 * GNU General Public License::
283 * GNU Free Documentation License::
290 @node Introduction, Using the library, Top, Top
291 @chapter Introduction
294 @node Using the library, Error Handling, Introduction, Top
295 @chapter Using the library
296 @cindex usage, compiling application programs
299 @node Error Handling, Mathematical Functions, Using the library, Top
300 @chapter Error Handling
304 @node Mathematical Functions, Complex Numbers, Error Handling, Top
305 @chapter Mathematical Functions
308 @node Complex Numbers, Polynomials, Mathematical Functions, Top
309 @chapter Complex Numbers
310 @include complex.texi
312 @node Polynomials, Special Functions, Complex Numbers, Top
316 @node Special Functions, Vectors and Matrices, Polynomials, Top
317 @chapter Special Functions
318 @include specfunc.texi
320 @node Vectors and Matrices, Permutations, Special Functions, Top
321 @chapter Vectors and Matrices
322 @include vectors.texi
324 @node Permutations, Combinations, Vectors and Matrices, Top
325 @chapter Permutations
326 @include permutation.texi
328 @node Combinations, Sorting, Permutations, Top
329 @chapter Combinations
330 @include combination.texi
332 @node Sorting, BLAS Support, Combinations, Top
336 @node BLAS Support, Linear Algebra, Sorting, Top
337 @chapter BLAS Support
340 @node Linear Algebra, Eigensystems, BLAS Support, Top
341 @chapter Linear Algebra
344 @node Eigensystems, Fast Fourier Transforms, Linear Algebra, Top
345 @chapter Eigensystems
348 @node Fast Fourier Transforms, Numerical Integration, Eigensystems, Top
349 @chapter Fast Fourier Transforms (FFTs)
352 @node Numerical Integration, Random Number Generation, Fast Fourier Transforms, Top
353 @chapter Numerical Integration
354 @include integration.texi
356 @node Random Number Generation, Quasi-Random Sequences, Numerical Integration, Top
357 @chapter Random Number Generation
360 @node Quasi-Random Sequences, Random Number Distributions, Random Number Generation, Top
361 @chapter Quasi-Random Sequences
364 @node Random Number Distributions, Statistics, Quasi-Random Sequences, Top
365 @chapter Random Number Distributions
366 @include randist.texi
368 @node Statistics, Histograms, Random Number Distributions, Top
370 @include statistics.texi
372 @node Histograms, N-tuples, Statistics, Top
374 @include histogram.texi
376 @node N-tuples, Monte Carlo Integration, Histograms, Top
380 @node Monte Carlo Integration, Simulated Annealing, N-tuples, Top
381 @chapter Monte Carlo Integration
382 @include montecarlo.texi
384 @node Simulated Annealing, Ordinary Differential Equations, Monte Carlo Integration, Top
385 @chapter Simulated Annealing
388 @node Ordinary Differential Equations, Interpolation, Simulated Annealing, Top
389 @chapter Ordinary Differential Equations
390 @include ode-initval.texi
392 @node Interpolation, Numerical Differentiation, Ordinary Differential Equations, Top
393 @chapter Interpolation
396 @node Numerical Differentiation, Chebyshev Approximations, Interpolation, Top
397 @chapter Numerical Differentiation
400 @node Chebyshev Approximations, Series Acceleration, Numerical Differentiation, Top
401 @chapter Chebyshev Approximations
404 @node Series Acceleration, Wavelet Transforms, Chebyshev Approximations, Top
405 @chapter Series Acceleration
408 @node Wavelet Transforms, Discrete Hankel Transforms, Series Acceleration, Top
409 @chapter Wavelet Transforms
412 @node Discrete Hankel Transforms, One dimensional Root-Finding, Wavelet Transforms, Top
413 @chapter Discrete Hankel Transforms
416 @node One dimensional Root-Finding, One dimensional Minimization, Discrete Hankel Transforms, Top
417 @chapter One dimensional Root-Finding
420 @node One dimensional Minimization, Multidimensional Root-Finding, One dimensional Root-Finding, Top
421 @chapter One dimensional Minimization
424 @node Multidimensional Root-Finding, Multidimensional Minimization, One dimensional Minimization, Top
425 @chapter Multidimensional Root-Finding
426 @include multiroots.texi
428 @node Multidimensional Minimization, Least-Squares Fitting, Multidimensional Root-Finding, Top
429 @chapter Multidimensional Minimization
430 @include multimin.texi
432 @node Least-Squares Fitting, Nonlinear Least-Squares Fitting, Multidimensional Minimization, Top
433 @chapter Least-Squares Fitting
434 @include fitting.texi
436 @node Nonlinear Least-Squares Fitting, Basis Splines, Least-Squares Fitting, Top
437 @chapter Nonlinear Least-Squares Fitting
438 @include multifit.texi
440 @node Basis Splines, Physical Constants, Nonlinear Least-Squares Fitting, Top
441 @chapter Basis Splines
442 @include bspline.texi
444 @node Physical Constants, IEEE floating-point arithmetic, Basis Splines, Top
445 @chapter Physical Constants
448 @node IEEE floating-point arithmetic, Debugging Numerical Programs, Physical Constants, Top
449 @chapter IEEE floating-point arithmetic
450 @include ieee754.texi
452 @node Debugging Numerical Programs, Contributors to GSL, IEEE floating-point arithmetic, Top
453 @appendix Debugging Numerical Programs
456 @node Contributors to GSL, Autoconf Macros, Debugging Numerical Programs, Top
457 @appendix Contributors to GSL
459 (See the AUTHORS file in the distribution for up-to-date information.)
463 Conceived GSL (with James Theiler) and wrote the design document. Wrote
464 the simulated annealing package and the relevant chapter in the manual.
467 Conceived GSL (with Mark Galassi). Wrote the random number generators
468 and the relevant chapter in this manual.
471 Wrote the statistical routines and the relevant chapter in this
475 FFTs, numerical integration, random number generators and distributions,
476 root finding, minimization and fitting, polynomial solvers, complex
477 numbers, physical constants, permutations, vector and matrix functions,
478 histograms, statistics, ieee-utils, revised @sc{cblas} Level 2 & 3,
479 matrix decompositions, eigensystems, cumulative distribution functions,
480 testing, documentation and releases.
482 @item Reid Priedhorsky
483 Wrote and documented the initial version of the root finding routines
484 while at Los Alamos National Laboratory, Mathematical Modeling and
486 @comment email: reid@reidster.net
489 Special Functions, Series acceleration, ODEs, BLAS, Linear Algebra,
490 Eigensystems, Hankel Transforms.
493 Wrote the Monte Carlo library.
495 @item Jorma Olavi T@"ahtinen
496 Wrote the initial complex arithmetic functions.
499 Wrote the initial heapsort routines and cholesky decomposition.
502 Multidimensional minimization.
505 Implementation of the random number generators in Knuth's
506 @cite{Seminumerical Algorithms}, 3rd Ed.
508 @item Szymon Jaroszewicz
509 @comment <sj@cs.umb.edu>
510 Wrote the routines for generating combinations.
513 Wrote the cyclic functions and the initial functions for canonical
516 @item Jason H. Stover
517 @comment (jason@sakla.net)
518 Wrote the major cumulative distribution functions.
521 Wrote the routines for wavelet transforms.
523 @item Tuomo Keskitalo
524 Improved the implementation of the ODE solvers.
527 Implementation of the Mathieu functions.
530 Implementation of non-symmetric and generalized eigensystems and B-splines.
534 Thanks to Nigel Lowry for help in proofreading the manual.
536 The non-symmetric eigensystems routines contain code based on the
537 LAPACK linear algebra library. LAPACK is distributed under the
545 Copyright (c) 1992-2006 The University of Tennessee. All rights reserved.
547 Redistribution and use in source and binary forms, with or without
548 modification, are permitted provided that the following conditions are
551 @bullet{} Redistributions of source code must retain the above copyright
552 notice, this list of conditions and the following disclaimer.
554 @bullet{} Redistributions in binary form must reproduce the above copyright
555 notice, this list of conditions and the following disclaimer listed
556 in this license in the documentation and/or other materials
557 provided with the distribution.
559 @bullet{} Neither the name of the copyright holders nor the names of its
560 contributors may be used to endorse or promote products derived from
561 this software without specific prior written permission.
563 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
564 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
565 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
566 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
567 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
568 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
569 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
570 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
571 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
572 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
573 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
582 @node Autoconf Macros, GSL CBLAS Library, Contributors to GSL, Top
583 @appendix Autoconf Macros
584 @include autoconf.texi
586 @node GSL CBLAS Library, Free Software Needs Free Documentation, Autoconf Macros, Top
587 @appendix GSL CBLAS Library
590 @comment @node Copyright, GNU General Public License, Contributors to GSL, Top
591 @comment @unnumbered Copyright
592 @comment @include science.texi
594 @node Free Software Needs Free Documentation, GNU General Public License, GSL CBLAS Library, Top
595 @unnumbered Free Software Needs Free Documentation
596 @include freemanuals.texi
598 @node GNU General Public License, GNU Free Documentation License, Free Software Needs Free Documentation, Top
599 @unnumbered GNU General Public License
602 @node GNU Free Documentation License, Function Index, GNU General Public License, Top
603 @unnumbered GNU Free Documentation License
606 @comment htmlhelp: @printindex fn
607 @comment htmlhelp: @printindex vr
608 @comment htmlhelp: @printindex tp
609 @comment htmlhelp: @printindex cp
610 @comment htmlhelp: @bye
616 @node Function Index, Variable Index, GNU Free Documentation License, Top
617 @unnumbered Function Index
621 @node Variable Index, Type Index, Function Index, Top
622 @unnumbered Variable Index
626 @node Type Index, Concept Index, Variable Index, Top
627 @unnumbered Type Index
631 @node Concept Index, , Type Index, Top
632 @unnumbered Concept Index
636 @ifclear frontcontents
637 @comment Use @setchapternewpage odd to ensure that the contents starts
638 @comment on an odd page so that it can always be moved to the front when
639 @comment printing two-up.
640 @setchapternewpage odd
644 @ifset extrablankpages
645 @comment final page must be blank for printed version