free and open-source C/C++ library for heavy-duty numerical computation

tags:

The GNU Scientific Library (GSL) is a collection of routines used by the mathematical and scientific research community. Other than symbolic computation (which is best handled by a package like Mathematica), the GSL covers all major computational areas. The library documentation is thorough and discusses choice of algorithm, choice of data structures, computational complexity, etc. References are provided.

Because of the way computers store numbers, care must be exercised in numerical computation to avoid overflow/underflow. GSL Special Functions routines produce the calculation result, and, optionally, an error estimate and code indicating whether overflow/underflow has occurred. For functions that frequently yield very large/small numbers, the GSL offers versions that return the logarithm of the result, making it easy to carry out calculations in $$\log$$ space.

The GSL also offers many routines for random number generation. It provides the popular Mersenne Twister MT19937 generator, among others, as well as functions for handling generator seeds and state. All (pseudo)-random number generators have finite periods, after which they repeat the same deterministic sequence. Care must be taken to ensure that any correlations observed in a simulated stochastic process are genuine, and not due to low quality random numbers!