NAG Automatic Differentiation dco/c++

NAG continues to innovate in Automatic Differentiation with our pioneering solution for numerical sensitivity analysis.

Contact our experts

NAG Automatic Differentiation dco/c++

Feature Rich,
Highly Efficient


NAG dco/c++ is the most powerful and widely used Automatic Differentiation technology for C++ on the market. It is a library of advanced mathematical and computer science algorithms built for calculating directional and adjoint derivatives of differentiable programs.


dco/c++ has been specifically designed and developed for continuous computational models. NAG dco/c++ is the most feature-rich and efficient automatic differentiation solution available.

Want to Learn More About NAG dco/c++?

Ask us anything

Derivatives Up To 36,000x Faster

dco/c++ provides low cost accurate first and higher-order tangent/directional and adjoint derivatives faster than alternative methods. In our studies we have seen examples of 36,000x speed-up.


dco/c++ is stringently tested and backed by over 50 years of experience and expertise. ​dco/c++ is a robust, commercially backed product, continuously maintained and updated. We deliver a robustness ​others can not, which can be the difference between success ​and failure.​

Enhanced Intelligence

dco/c++  provides enhanced intelligence that enables faster, better, more informed decisions. 

Backed by Science

dco/c++ is backed by science. NAG ensures that our product and your investments are future-proofed through collaboration, innovation, and investment. 

Derivative Code by Overloading Software


NAG dco/c++ is a feature-rich library of advanced mathematical and computer science algorithms. It is built to vastly improve numerical sensitivity analysis and decision-making through enhanced intelligence.


dco/c++ calculates first and higher-order tangent and adjoint derivatives up to 36,000x faster than alternative methods, and with machine accuracy. It is a robust, commercially backed, supported, continuously maintained and updated product. Ultimately, dco/c++ delivers confidence, peace of mind and a competitive edge to any business using continuous computational models. 

Proof of Concept


An expert assessment of the impact that AD would bring to your modeling, and business function, giving you the confidence to move forward with an AD investment strategy.

NAG AD experts collaborate with you to integrate an AD solution into your models. We provide assistance in evaluating the effectiveness of the solution, supporting you in demonstrating the impact of your investment.

During implementation, NAG’s AD Consultant Developers will work with you on: ​

  • Success metrics ​
  • Design support​
  • Debugging​
  • Performance tuning​
  • Handling library dependencies ​
  • Selecting features​



With NAG there are no delays to projects and you can have maximum confidence in your operations. Our experts are always on hand to make sure you are safe in the knowledge that there will always be someone ready to help you.​


NAG will provide troubleshooting telephone, email, or video call support on API and features, triaging bugs and fixing them, and “general advice” on AD to a level which ensures the customer gets the best out of the dco/c++.​



Take advantage of the NAG world-class developers and their expert knowledge to train your teams to work with dco/c++ in the most effective way for your business. Our comprehensive training ensures best practices are used and dco/c++ is implemented in the most efficient way and is designed with your specific needs in mind.

  • Header-only Library

    Easy integration and high performance.

  • Vectorized tangents and adjoints
  • Support for parallelism in shared and distributed memory environments
  • Dynamic code generation

    A hybrid technology that combines the efficiency of source transformation with the flexibility and ease of use of an operator overloading tool.

  • User-defined tape callbacks

    Combine dco/c++ with hand-written adjoints, symbolic adjoints (e.g., implicit function theorem), or any other way of computing sensitivities of embedded algorithms.

  • Sparsity pattern detection

    Cheaply detect zero entries in your derivative tensor.

  • Tape compression

    Preaccumulating local Jacobians reduces tape size and tape interpretation time.

  • Support for the C++ standard Library

    STL, BLAS, Boost, Eigen, …. and more.

  • Support for the NAG AD Library
What’s new in dco/c++ 4.3
  • Enhancement of the codegen feature by introduction of active integers with support for conditions.
  • Compile time of generated codes improved by better supporting loops.
  • Implementation of experimental debugging feature to detect control flow divergence for finite difference computations.
What’s new in dco/c++ 4.2 
  • Enhanced usability through increased cmath function coverage: std::cbrt, std::copysign, std::exp2, std::log2, std::scalbn, std::scalbln, std::fpclassify, std::isgreater, std::isgreaterequal, std::isless, std::islessequal, std::islessgreater, std::isunordered, std::lrint, std::llrint, std::llround, std::nearbyint, std::rint, std::signbit.
  • Requirements on codegen loosened: registration of inputs now possible anywhere in the code.
  • Enhanced usability through type trait for retrieving the vector length from a dco/c++ type.
What’s new in dco/c++ 4.1
  • New data type ‘dco::multi_mode’: This release brings a new data type that can combine arbitrary dco/c++ functionality in one go. It is intended to reduce the number of required instantiations of the underlying code. This reduces the complexity of the build system and leads to an expected reduction in compilation times. With this type, you can, e.g., record a tape and, at the same time, propagate vector tangents.
  • API update for Jacobian preaccumulator and the local gradient functionality (factory methods).
  • More precise information on memory consumption enabled by new enum (`dco::size_of_e`).
  • Enhanced debugging capabilities: Beside writing the tape in csv- or dot-format, we now enable to print the tape to a stream in a human-readable format.
What’s new in dco/c++ 4.0
  • Code generation: A hybrid technology that combines the efficiency of source transformation with the flexibility and ease of use of an operator overloading tool, with support for primal, tangent and adjoint code. This supports all combinations of scalar and vector modes for computing first and higher derivatives.
  • The use of source transformation gives two advantages: in the transformation step and in the compilation step. In the transformation step, they can implement optimisations based on properties of the underlying differentiation rules. In addition, in the compilation step, the built-in optimisation passes of steadily advancing compilers are simply inherited. Showstoppers usually: Applicability and maintainability. 
  • dco/c++ 4.0 uses overloading techniques to generate a representation of the program in memory, and unparse the various modes (primal, tangent, adjoint) into a C++ file. The dynamic nature of this approach (building the representation at run time) introduces an important constraint on the code to be differentiated – the control flow is not allowed to depend on input data. We overcome this constraint for branches with smart use of modern C++ features such as lambda expressions, in combination with classical elements from the preprocessor.
  • Support for std::ldexp and std::frexp.
  • Aligned memory allocation by default. In some circumstances, this leads to more efficient memory access for vectorized operations.
  • Requires C++17 now.


Try NAG dco/c++


Want to see how NAG dco/c++ can work with your application? Take a trial today.

Learn More


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

More Insights


To learn more about what NAG can help you with, visit our insights page.

    Please fill out all of the following questions

    What solvers are you interested in trying? (multiple choice)

    By clicking the button below you agree to our Privacy Policy

    This will close in 20 seconds