xad v2.2.0
Permanent link:
cppdashboard.dev/r/2026/11/xad-v2-2-0The fastest automatic differentiation library for C++, with Python bindings. Forward, adjoint and higher-order derivatives, checkpointing, Eigen support and JIT. Reproducible benchmarks against CppAD, Adept and autodiff.
Release notes
## What's New ### Faster recording and adjoint sweeps - Recording passes the multiplier through sums, differences and negations, so higher-order types build fewer nested products - `std::complex<AReal>` arithmetic records fewer tape statements - The adjoint sweep visits each statement's operands last to first, and chunk crossings stay out of the hot path in recording and in the sweep - Faster forward mode: packed masking of zero tangents, one reciprocal per vector division, larger `FReal` operands held by reference - Higher-order tapes over `FReal` write their partials straight into the tape ### New and improved tape options - `XAD_COPY_ELISION` (new, off by default): copies share the slot of their source and record nothing; see the Build Options page for the supported use - `XAD_REDUCED_MEMORY`, `XAD_SKIP_ZERO_PARTIALS`, `XAD_TAPE_TRACK_LIVE_SLOTS`, `XAD_OUTLINE_RECORDING`, `XAD_TAPE_REUSE_SLOTS`, `XAD_LINEAR_SLOTS`, `XAD_HUGE_PAGES`, `XAD_TLS_INITIAL_EXEC` and `XAD_SHARED_LIBS` are new or improved since 2.0.0 - New [Build Options](https://github.com/auto-differentiation/xad/blob/v2.2.0/docs/ref/build-options.md) page: what each performance-related option does, when it helps, and starting sets per kind of workload ### Direct mode, samples and fixes - Direct mode types (`ARealDirect`, `FRealDirect`) are drop-in replacements for `AReal`/`FReal` - New samples: SIR calibration, Nelson-Siegel curve fit, projectile aiming, Eigen decompositions - Many fixes in tape chunk handling, checkpointing, `resetTo`, JIT recording, Eigen and libc++ compatibility ### Upgrade notes - Expression types defined outside XAD (deriving from `xad::Expression`) need `calc_derivatives(info, tape)` and `calc_derivatives(info, tape, detail::minus_unit)` overloads - Forward-mode expressions over larger `FReal` types hold their operands by reference: don't keep one past its full expression - `std::numeric_limits<T>::is_iec559` is `false` for active types See the [CHANGELOG](https://github.com/auto-differentiation/xad/blob/main/CHANGELOG.md) for the full list. If XAD helps you, a GitHub star helps others find it
Share this resource