Skip to content
@auto-differentiation

auto-differentiation

Comprehensive automatic differentiation framework

XAD - Comprehensive Automatic Differentiation

XAD is the fastest automatic differentiation library for C++ and Python, built for production-scale systems. Proven in codebases of hundreds of thousands of lines, with 1,200+ tests and ~99% coverage.

Ecosystem

Repository Description Language
xad Core AD library - forward & adjoint mode, JIT support, Eigen integration C++
xad-py Python bindings for XAD Python
QuantLibAAD Full QuantLib integration - compute all Greeks at once, up to 3 orders of magnitude faster than bump-and-reval C++
QuantLibAAD-Py QuantLib risks from Python via XAD Python
xad-codegen High-performance native code generation backend for XAD - record-once/replay-many at maximum throughput (commercial) C++
ad-benchmarks AD benchmarks on quant-finance workloads (LMM, Heston, CVA, SABR): XAD against CppAD, Adept 2 and autodiff, every gradient checked C++

Performance

XAD is the fastest open-source C++ AD library on four quant-finance workloads, benchmarked against CppAD, Adept 2, and autodiff. XAD computes all sensitivities 6.5x to 83x faster than bump-and-reval, and the commercial code generation add-on (xad-codegen) a further 4x to 17x faster than XAD alone.

Speed-up over bump-and-reval per workload for XAD, XAD + codegen, Adept 2, CppAD and autodiff

XAD v2.2.0, AMD EPYC (Zen 5), one core, GCC 15.2, run 10 November 2026. Full methodology and source: ad-benchmarks.

GradBench

With code generation, XAD is the fastest of the C and C++ AD tools on all 11 GradBench problems, and on average 2.4x faster than the next-fastest tool.¹ On seven problems the generated code beats hand-written derivatives. Without code generation, open-source XAD is the fastest tape-based AD tool on 7 of the 11 and second on the other four. Full results

¹ Geometric mean of the 11 ratios to the fastest other AD tool, open-source XAD excluded. Measured by Xcelerit with GradBench's harness and tool images, 16 November 2026; not GradBench's nightly results.

Why XAD?

  • Fastest AAD library for C++ - independently benchmarked
  • Production-proven in large-scale quantitative finance systems
  • Full QuantLib integration with 3 orders of magnitude speedup over bump-and-reval
  • Eigen compatible - drops into existing C++ codebases with minimal changes
  • 1,200+ tests, ~99% coverage
  • Python bindings available via pip install xad

Get Started

Documentation


If XAD is useful to you, please star the core repository — it helps others find it.

Pinned Loading

  1. xad xad Public

    The fastest automatic differentiation library for C++, with Python bindings. Forward, adjoint and higher-order derivatives, checkpointing, Eigen support and JIT. Reproducible benchmarks against Cpp…

    C++ 445 56

Repositories

Showing 6 of 6 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…