
The NAG Library for Fortran
NAG Library algorithms − performance driven − accurate to the core. Algorithms developed to solve complex mathematical problems quickly and easily. Algorithms that are stringently tested, expertly documented, supported and continually updated with new cutting edge algorithmic functionality. Whether in business critical applications or ground-breaking research, good numerical algorithms are the difference between success or failure.
Can you afford not to use NAG's algorithmic expertise?
We've selected key highlights from the NAG Library and show in more detail how a particular function or set of functions can be used. To learn more about a specific area/function click on the relevant link below.
- Second Order Cone Programming (SOCP) Mini Article, NEW Technical Poster NEW & GitHub Examples NEW
- Derivative-free Optimization Solver for Calibration Problems Technical Poster NEW & Mini Article NEW
- Nearest Correlation Matrix Technical Poster, NEW GitHub Examples NEW & Mini Article NEW
- Randomized Numerical Linear Algebra (RNLA) Algorithms NEW
- Non-negative Matrix Factorization for Analysing High-dimensional Datasets Slide Deck NEW & GitHub Examples NEW
- Algorithmic Differentiation Routines
- Derivative-free Optimization for Data Fitting
- Struve Functions
- NAG Optimization Modelling Suite
- Interior Point Method for Large Scale Linear Programming
- Interior Point Method for Nonlinear Optimization
- Semidefinite Programming (SDP)
- Three Body Problem using High-Order Runge–Kutta Interpolation
- Mixed Integer Nonlinear Programming
- Unscented Kalman Filter
- LARS / LASSO / Forward Stagewise Regression
- Change Point Analysis
- Confluent Hypergeometric Function
- Two-stage Spline Approximation to Scattered Data
- Multi-start Optimization
- Optimization for Non-negative Least Squares
- Matrix Functions
- Inhomogeneous Time Series
- Gaussian Mixture Model
- Best subset
- Bound Optimization BY Quadratic Approximation
- Linear Quantile Regression
- Sampling with Unequal Weights
- Calling random number generators from a multi-threaded environment
- Copulas
- Skipping Ahead the Mersenne Twister Random Number Generator
- Global Optimization
- Partial Least Squares / Ridge Regression
- Quantiles
- Search routines
The NAG Library Manual, Mark 27 is available in the following formats:
The Library consists of a number of generic interfaces:
- the FL interface, a standard set of interfaces that utilise only simple types which makes them suitable for calling from a wide range of languages, including Fortran (NAG's traditional Fortran Library interfaces), C, C++, VBA and others;
- the CL Interface, NAG's traditional set of C Library interfaces;
- and the NAG AD Library interfaces to support Algorithmic Differentiation.
In addition to the generic interfaces described in this manual, NAG supports interfaces tailored to specific environments and programming languages, including Python, Java, .NET and MATLAB®.
The Library is organized 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 online to facilitate their use as templates for the users' calling programs.
The NAG Library Manual - prior releases
Previous releases of the NAG Library Manual are available from here
Installer's Notes and Users' Notes
Support documentation for the installation and use of each implementation of the NAG Library is available.
Produced by experts for use in a variety of applications, the NAG Library is the largest commercially available collection of numerical and statistical algorithms in the world. With over 1,600 tried and tested routines that are both flexible and portable it remains at the core of thousands of programs and applications spanning the globe. The NAG Library is widely used and trusted because of its unrivalled quality, reliability and portability. Whether it is a single PC or a cluster of the world’s largest supercomputers, the NAG Library has the numerical capabilities to fit your model. The NAG Library is available for use with many programming languages and for many platforms and operating systems.
The NAG Fortran Library is available as a Dynamic Link Library (DLLs) for use on Windows systems.
Services and Support
NAG’s Technical Support Service is provided by a team of specialists in numerical and statistical software development, in fact the NAG Library and Compiler development team share responsibility for the support of our software. We strongly believe that in order to effectively support complex software the technicians must be both experienced and understand the intricacies of the computational techniques. This conviction is reflected in the composition of the team most of whom are qualified to PhD level and have combined experience of software support in excess of 50 years.
NAG provides accurate, documented, numerical software and services to help you make sure that your results are accurate. The validity of each NAG routine is tested for each platform that it is enabled for. 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 NAG to give you the right answers. NAG is an ISO 9001 certified organization.
The numerical codes that underpin the results from your software are not future proof. While the mathematics does not change, the codes have a limited lifespan because of new hardware structures, mathematical innovation and changes in application needs. NAG Numerical Services help you and your organization find and implement the optimum numerical computation solutions. NAG works with your team to impart skills and techniques that will help solve your numerical software problems.
Your users, developers and managers can all benefit from NAG's highly regarded training courses. All of the training courses shown below have been delivered successfully either from NAG offices or at client premises. Training courses can be tailored to suit your particular requirements and be targeted to novice, intermediate or experienced levels. Specialized mentoring and development programs are also available for HPC managers.
NAG was founded on collaboration as an inter-University collaborative venture combining the talents of mathematicians and computer scientists. NAG has continued to collaborate with individuals and organizations over the past four decades and today longstanding and new partners are delivering tangible benefits to users and students all over the world.
NAG provides expert AD services and software to differentiate computer code. NAG has a wealth of information on the subject of AD; learn more about this novel mathematical approach.

Providing highly flexible, accurate solvers, and an expert consultancy service for mathematical optimization, aiding critical decision making on a small or grand scale.

The NAG Fortran Compiler is robust, highly tested, and valued by developers all over the globe for its checking capabilities and detailed error reporting.

Organizations from a diverse set of industries and academic areas rely on NAG to power their numerical capabilities. See how they benefit from NAG's software and services.
