NAG Library

Helping to solve the most complex numerical challenges across industries.

Trial now Contact our experts

NAG Library

Rigorously Tested, Inherently Flexible


NAG Library is a collection of 1600+ numerical and statistical algorithms callable from many computer programming languages and environments. It is component based to provide the building blocks to solve thousands of complex numerical problems.


Available for multiple languages and environments including C and C++, Python, Java, .NET, and Fortran.


NAG Library algorithms cover: 

  • Mathematical Optimization 
  • Statistics and Machine Learning 
  • Special Functions  
  • Linear Algebra 
  • PDEs 
  • Interpolation 
  • Curve & Surface Fitting 
  • Numerical Integration  

Talk to an Algorithm Expert

Talk to us


Reduce project costs and remove the complications of using multiple libraries and licences. The NAG Library covers a wide range of mathematical and statistical computing techniques and models.


The NAG Library undergoes strict testing, meticulous documentation, and regular maintenance, making it an extremely robust solution.


NAG Library algorithms are accessible across various languages and environments, facilitating seamless transition from prototype to production. Interactive documentation allows for easy language switching.


From day one, NAG Technical Support strives to maximize the benefits of NAG Library software for users. The Technical Support team has earned a reputation for expert, trusted, and timely problem resolution.

Active-set Method for Nonlinear Optimization: Mini Article

General Nonlinear Data Fitting: Mini Article, Python Examples, Java Examples

Faster Data Fitting (Calibration): Mini Article, Python Examples, Java Examples

Fast Implied Volatilities: Mini Article, Python Examples, Java Examples

Solving Convex and Non-convex Quadratically Constrained Quadratic Programming (QCQP) Problems: Mini Article, Python Examples, Java Examples

Solving Convex Problems with Second-order Cone Programming (SOCP): Mini Article, Technical Poster & Python Examples

Derivative-free Optimization Solver for Calibration Problems: Technical Poster & Mini Article

Flexible Modelling with the NAG Optimization Modelling Suite: Product Page

First-order Active-set Method for Nonlinear Programming: Mini Article, Python Examples

Nearest Correlation Matrix: Technical Poster, Python Examples, Java Examples & Mini Article

Randomized Numerical Linear Algebra (RNLA) Algorithms: Technical Poster

Non-negative Matrix Factorization for Analysing High-dimensional Dataset: Python Examples

Polynomial Root-finding: Blog

Correlation & Regression Analysis – Learn more

Random Number Generators – Learn more

Multivariate Methods – Learn more

Univariate Methods – Learn more

Nonparametric Statistics – Learn more

Smoothing in Statistics – Learn more

Survival Analysis – Learn more

Time Series Analysis – Learn more

Linear Model Specification – Learn more

Mathematical Optimization Software – Learn more

Interpolation – Learn more

Curve & Surface Fitting – Learn more

Try the NAG Library


Want to see what the NAG Library can do for you? Take a trial today.

Talk to Us


Our expert consultants are on hand to answer any questions you may have.

Case Studies


Take a look at our collection of Case Studies to learn more about what the NAG Library can do.

NAG Library for C, C++,
Fortran, AD


Using NAG Library algorithms enables you to easily switch between programming languages giving heightened flexibility and performance – the algorithms are future-proofed to ensure accuracy and performance.

The NAG Library is callable from Visual Basic, F#, R and PHP. A parallelised OpenMP version is available.

.NET & C#


NAG provides a software solution for users of the Microsoft .NET framework to access the extensive mathematical and statistical algorithms in the NAG Library. NAG’s fast and efficient algorithms enhance application capabilities and reduce crucial development time.



The NAG Library for Python provides Python developers with a tested, documented, and supported comprehensive collection of numerical algorithms, including mathematical optimization solvers, making it easier than ever to solve complex computational problems efficiently. From optimization and interpolation to linear algebra and statistical analysis, the NAG Library equips programmers with the tools needed to accelerate scientific and engineering computation with precision and ease.



The NAG Toolbox for MATLAB® provides a one stop solution to solve problems in diverse mathematical areas. It is expertly documented, maintained, and supported, and is regularly updated with cutting-edge algorithmic capabilities.



The NAG Library for Java provides flexible and robust, documented, tested and maintained numerical algorithms for users of the Java programming language.

Try the NAG Library


Want to see what the NAG Library can do for you? Take a trial today.

Talk to Us


Our expert consultants are at hand to answer any questions you may have.



Take a look at our collection of Insights to learn more about the NAG Library and our other products & services.