This page contains libraries and source code for numerical, mathematical, and statistical (stats) functions and other routines that will (hopefully) make programming applications that require such computations easier. Note: if what you want is only to draw graphs, you might also want to check the Free Image Drawing Source Code, Graphics Libraries, 3D Engines/2D Engines, Image Drawing, Animation Libraries page as well.

MathGL is a library for writing high-quality scientific graphics under Linux and Windows. It supports large arrays, plotting of one, two and three dimensional plots, and can export graphics to bitmap (PNG, JPEG, TIFF) and vector (EPS or SVG) files. It can be used from console programs, has functions for data handling and script MGL language for simplifying data plotting, supports several types of transparency and smoothed lighting, vector fonts and TeX-like symbol parsing, arbitrary curvilinear coordinate systems, has an OpenGL interface, etc. It is licensed under the GNU General Public License.

MAGMA is a dense linear algebra library that takes advantage of the power of CPUs with multiple cores and GPUs. It uses a similar programming interface to LAPACK (see elsewhere on this page), except that it uses a hybrid CPU/GPU algorithm to produce its results. (I'm simplifying here; please read their documentation for the actual details.)

LAPACK is a package of routines written in Fortran 77 intended for "solving systems of simultaneous linear equations, least-squares solutions of linear systems of equations, eigenvalue problems, and singular value problems" (quoted from the website). Included are matrix factorizations (LU, Cholesky, QR, SVD, Schur, generalized Schur), facilities for the reordering of the Schur factorizations and estimating condition numbers. The routines can also handle dense and banded matrices, real and complex matrices, in single and double precision.

GSL is a numerical library that may be used in C and C++ programs. Functions available include complex numbers, roots of polynomials, vectors and matrices, permutations and combinations, sorting, linear algebra, BLAS support, fast fourier transforms, random numbers, histograms and statistics, Monte Carlo integration, N-Tubes, 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, etc. It is released under the GNU General Public License. It has been ported to SunOS, Linux (x86 and Alpha), HP-UX, IRIX, NeXTSTEP, Tru64 Unix, FreeBSD, OpenBSD, NetBSD, Windows, Mac OS X, etc.

IML++ is a C++ template library containing iterative methods for solving symmetric and non-symmetric linear systems of equations. You can use the same routines for dense, sparse and distributed matrices.

TurboPower SysTools contain numerous utility functions and classes for Borland Delphi/Kylix and Borland C++ Builder as well as programming environments that support COM objects (like Microsoft Visual Basic, Microsoft Visual C++. Among the routines included in this library are string manipulation routines, date and time math routines, high-speed sorting, high-precision maths, runtime math expression analyzer, Microsoft Excel-like finance and statistical routines, email attachment MIME encoding and decoding, reusable containers (stacks, queues, trees, deques, hash tables), CRC data integrity checking, 1 dimensional and 2 dimensional (1-D and 2-D) bar codes, money routines, logging classes, patterns, random number distributions, text data manipulation and more. SysTools is open source, released by TurboPower under the Mozilla Public License. It works on Windows systems.

This is a pseudorandom number generator written in C (with source code provided). It is purportedly fast, uses memory efficiently, and has a "far longer period and far higher order of equidistribution than any other implemented generators" (their claim). There is also a Fortran version available from the site.

Blitz++ is a C++ class library for linear algebra and uses numerous techniques to speed up matrix operations. It supports dense arrays and vectors, small vectors and matrices, provides random number generators, etc. It is released under the GNU General Public License.

This is a C++ class library that allows you to make "efficient sparse matrix computations across various computational platforms." Included in the library are "matrix classes encompassing several sparse storage formats (eg compressed row, compressed column and coordinate formats)" (quotes taken from their website). It is available in source code form, with documentation available in postscript format.

Cephes is a C library that provides numerous mathematical functions including support for the complex variable types that will be in the new ANSI C standard, C99. Among the numerous functions available are: the elementary functions (log, sin, cos, exp, etc), gamma, psi, dilogarithm, Airy, Bessel, hypergeometric, Struve, complete and incomplete elliptic functions, Planck radiation, Fresnel integrals, probability integrals and their inverses (Gaussian, Poisson, F, Chi-square, binomial, Kolmogorv-Smirnov arithmetic on polynomials, rationals, etc), and so on. You can get it with precisions from single, double, long double (80, 96 or 128 bit), q-class (384-bit). Source code is available, as well as precompiled binaries for Linux, Windows and MSDOS.

This C++ framework makes it easy for you to integrate symbolic and algebraic manipulations with "other areas of computer science like computation-intensive numeric applications, graphical interfaces, etc". You also get "a parser for constructing expressions from strings, inert differentiation, archival of symbolic expressions, etc." The library is released uner the GNU GPL.

This award winning library is a C library for "computing the Discrete Fourier Transform (DFT) in one or more dimensions, of both real and complex data, and of arbitrary input size." It is portable, fast and free.