Go to the first, previous, next, last section, table of contents.

# Introduction

The GNU Scientific Library (GSL) is a collection of routines for numerical computing. The routines have been written from scratch in C, and present a modern Applications Programming Interface (API) for C programmers, allowing wrappers to be written for very high level languages. The source code is distributed under the GNU General Public License.

## Routines available in GSL

The library covers a wide range of topics in numerical computing. Routines are available for the following areas,

Complex Numbers | Roots of Polynomials
Special Functions | Vectors and Matrices
Permutations | Combinations
Sorting | BLAS Support
Linear Algebra | BLAS Support
Fast Fourier Transforms | Eigensystems
Random Numbers | Quadrature
Random Distributions | Quasi-Random Sequences
Histograms | Statistics
Monte Carlo Integration | N-Tuples
Differential Equations | Simulated Annealing
Numerical Differentiation | Interpolation
Series Acceleration | Chebyshev Approximations
Root-Finding | Discrete Hankel Transforms
Least-Squares Fitting | Minimization
IEEE Floating-Point | Physical Constants

The use of these routines is described in this manual. Each chapter provides detailed definitions of the functions, followed by example programs and references to the articles on which the algorithms are based.

## GSL is Free Software

The subroutines in the GNU Scientific Library are "free software"; this means that everyone is free to use them, and to redistribute them in other free programs. The library is not in the public domain; it is copyrighted and there are conditions on its distribution. These conditions are designed to permit everything that a good cooperating citizen would want to do. What is not allowed is to try to prevent others from further sharing any version of the software that they might get from you.

Specifically, we want to make sure that you have the right to give away copies of any programs related to the GNU Scientific Library, that you receive their source code or else can get it if you want it, that you can change these programs or use pieces of them in new free programs, and that you know you can do these things.

To make sure that everyone has such rights, we have to forbid you to deprive anyone else of these rights. For example, if you distribute copies of any related code which uses the GNU Scientific Library, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. This means that the library should not be redistributed in proprietary programs.

Also, for our own protection, we must make certain that everyone finds out that there is no warranty for the GNU Scientific Library. If these programs are modified by someone else and passed on, we want their recipients to know that what they have is not what we distributed, so that any problems introduced by others will not reflect on our reputation.

The precise conditions for the distribution of software related to the GNU Scientific Library are found in the GNU General Public License (see section GNU General Public License). Further information about this license is available from the GNU Project webpage Frequently Asked Questions about the GNU GPL,

- `http://www.gnu.org/copyleft/gpl-faq.html`

## Obtaining GSL

The source code for the library can be obtained in different ways, by copying it from a friend, purchasing it on CDROM or downloading it from the internet. A list of public ftp servers which carry the source code can be found on the GNU website,

- `http://www.gnu.org/software/gsl/`

The preferred platform for the library is a GNU system, which allows it to take advantage of additional features in the GNU C compiler and GNU C library. However, the library is fully portable and compiles on most Unix platforms. It is also available for Microsoft Windows. Precompiled versions of the library can be purchased from commercial redistributors listed on the website.

Announcements of new releases, updates and other relevant events are made on the `gsl-announce` mailing list. To subscribe to this low-volume list, send an email of the following form,

    To: gsl-announce-request@sources.redhat.com
    Subject: subscribe

You will receive a response asking to you to reply in order to confirm your subscription.

## An Example Program

The following short program demonstrates the use of the library by computing the value of the Bessel function J_0(x) for x=5,

    #include <stdio.h>
    #include <gsl/gsl_sf_bessel.h>

    int
    main (void)
    {
      double x = 5.0;

      double y = gsl_sf_bessel_J0 (x);

      printf("J0(%g) = %.18e\n", x, y);

      return 0;
    }

The output is shown below, and should be correct to double-precision accuracy,

    J0(5) = -1.775967713143382920e-01

The steps needed to compile programs which use the library are described in the next chapter.

## No Warranty

The software described in this manual has no warranty, it is provided "as is". It is your responsibility to validate the behavior of the routines and their accuracy using the source code provided. Consult the GNU General Public license for further details (see section GNU General Public License).

## Further Information

Additional information, including online copies of this manual, links to related projects, and mailing list archives are available from the development website mentioned above. The developers of the library can be reached via the project's public mailing list,

`gsl-discuss@sources.redhat.com`

This mailing list can be used to report bugs or to ask questions not covered by this manual.

Go to the first, previous, next, last section, table of contents.