auto-differentiation/xad

Fast, easy automatic differentiation in C++

What it solves

XAD is a high-performance C++ library that provides automatic differentiation (AD), allowing developers to compute derivatives of functions with high precision and efficiency. It is specifically designed for large-scale, performance-critical systems where low runtime overhead and minimal memory usage are required.

How it works

XAD uses operator overloading to implement both forward and adjoint (reverse) mode automatic differentiation. It can compute multiple derivatives simultaneously via vector mode. For repetitive workloads like Monte Carlo simulations, it offers an abstract JIT (Just-In-Time) backend interface to enable a "record-once / replay-many" execution model. It also includes checkpointing support to manage tape memory more efficiently in large applications.

Who it’s for

C++ developers building performance-critical mathematical models, particularly in quantitative finance (as evidenced by its integration with QuantLib), and anyone needing a high-speed automatic differentiation tool for large-scale systems.

Highlights

  • Dual Mode Support: Provides both forward and reverse (adjoint) mode AD.
  • High Performance: Optimized for low runtime overhead and minimal memory footprint.
  • JIT Backend: Optional infrastructure for pluggable JIT backends to increase throughput.
  • Broad Integration: Works with the Eigen linear algebra library and provides an external function interface.
  • Checkpointing: Efficient memory management for tape-based differentiation.

Related

  • Project
  • Project
  • Project
  • Project