The NAG C Library


The largest commercially available collection of numerical algorithms for C

The NAG C Library is the largest and most comprehensive collection of mathematical and statistical algorithms for C and C++ programmers available today. Organizations all over the world rely on the NAG C Library because of the quality and accuracy the software gives to their work.

Containing more than 1,400 functions covering a wide range of mathematical and statistical areas, NAG C Library contains algorithms which are powerful, reliable, flexible and ready for use from a wide range of operating systems, languages, environments and packages including Excel, Java, MATLAB, .NET/C# and many more.

NAG Library Contents

The key numerical and statistical capabilities of the C Library are shown below. To learn more about the new chapters and improved routines at Mark 23 follow this link. A complete list of the contents of the Library is available in the online manual.

Key Features

  • Optimization - local and global optimization solvers
  • Ordinary and partial differential equations
  • Wavelet transforms
  • Option pricing
  • Partial least squares and ridge regression
  • Nearest correlation matrix
  • Quantiles
  • Mesh generation
  • Numerical integration
  • Roots of nonlinear equations (including polynomials)
  • Dense, banded and sparse linear equations
  • Eigenvalue problems
  • Linear and nonlinear least squares problems
  • Special functions
  • Curve and surface fitting and interpolation
  • Large scale eigenproblems
  • Large, sparse systems of linear equations
  • Random number generation
  • Simple calculations of statistical data
  • Correlation and regression analysis
  • Multivariate methods
  • Analysis of variance and contingency table analysis
  • Time series analysis
  • Nonparametric statistics
  • Copulas
  • Mixed effects regression
  • Stepwise linear regression

Regular Updates

To ensure that we meet your existing and future requirements, the library is regularly updated with new and enhanced algorithms for use in evolving business areas. If you are a user of the NAG C Library and have suggestions for new routines please contact us.

Online Documentation

The software in the library is accompanied by first-class electronic help giving you the detailed information you need to carry out your work quickly and effectively.

Expert Support

Subscription to our dedicated Technical Support Service includes automatic notification of updates and access to our domain experts who are there to assist you with your technical queries or difficulties.

Quality Assurance

The validity of each function is tested on each of the machine ranges for which the product is available. Only when an implementation satisfies our stringent accuracy standards is it released. As a result, you can rely on the proven accuracy and reliability of the functions to give you the right answers.


Supporting Documentation

The NAG C Library Manual - Mark 23

Can be viewed on-line in the following formats:

  • HTML: The full manual available as HTML (using HTML5 features such as MathML and SVG in suitable browsers);
  • PDF: the same manual as above, consisting of many PDF files, may be browsed using PDF bookmarks or via the HTML table of contents pages;
  • Single file PDF: the manual as a single PDF file;
  • ZIP file: The archive as a ZIP file (128MB);
  • Windows html help: Windows html help version as a single file ;
    (Note: due to windows security restrictions the help file may not be read directly from the internet. Save a copy to your local disk, and then read the local copy. Also depending on the Windows version installed you may need to unblock files copied from the internet before they may be used (right click on the help file and select properties then select the "unblock" button).

Advice on viewing and navigating the first three formats can be found in the Online Documentation help document. You are strongly advised to read this document if you wish to try the HTML+MathML format.

The two single file formats are more compact than the formats using one file per routine, but of course are a larger download if you only need to view the documentation for a few routines.

The Library is organised into Chapters - each being documented with its own Introduction and Contents list followed by a comprehensive document for each function detailing its purpose, description, list of parameters and possible error exits. Example programs and results are also supplied. All examples are available on-line to facilitate their use as templates for the users' calling programs.

Error Bulletin for the NAG C Library, the error bulletin contains a list of errors or other problems which are known to exist in the NAG C Library, along with suggested workarounds where possible.

The NAG C Library Manual - Mark 9 and prior

The previous marks of the NAG C Library Manual are still available: Mark 7, Mark 8 and Mark 9.

Installer's Notes and Users' Notes

Support documentation for the installation and use of each implementation of the NAG C Library is available.

Product Availability

The following table provides a simple mechanism by which you can determine the most appropriate NAG C Library implementation for your needs. The table is organized by grouping implementations firstly by operating system and secondly by compiler; you simply select the combination appropriate to the system that you use. The most important information that you can derive from this is the NAG product code which is located in the rightmost column of each record and is a 10 character string beginning CL.


Intel C++ (Includes DLL Windows API) 32 bit CLW3223DAL
Intel C++ (Includes DLL Windows API) 64 bit CLW6I23DAL

Linux (x86)

Intel C++ 32 bit CLLUX23DCL
Intel C++ 64 bit CLL6I23DCL
GNU C 32 bit CLL3A09DGL
GNU C 64 bit CLL6A23DGL
GNU C 64 bit (ILP64) CLL6A23DHL

Linux (Itanium)

Intel C++ 64 bit CLL6408DCL
GNU C 64 bit CLL6407DAL

Linux (IBM Cell)

IBM xlc 32 bit CLIC308DAL
IBM xlc 64 bit CLIC608DAL

Mac OS X

GNU C 64 bit CLMI623DGL


IBM xlc 32 bit CLAI308DAL
IBM xlc 64 bit CLAI608DAL


HP C 32 bit CLH9708DAL
HP C 64 bit CLHP808DAL

HP-UX (Itanium)

HP C 64 bit CLHPI08DAL

Solaris (SPARC)

Sun C 64 bit CLSO608DCL
Sun C 32 bit CLSOL08DCL
Fujitsu C 64 bit CLFSV08DAL

Solaris (x86)

Sun C 32 bit CLSA309DCL

Website Feedback

If you would like a response from NAG please provide your e-mail address below.

(If you're a human, don't change the following field)
Your first name.
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Enter the characters shown in the image.