# autodiff/autodiff

automatic differentiation made easier for C++

Repository: https://github.com/autodiff/autodiff
Canonical: https://ross.abutalabs.com/products/autodiff
Homepage: https://autodiff.github.io
Language: C++
License: MIT
License Family: permissive
Topics: automatic-differentiation, auto-differentiation, autodiff, autodifferentiation, differentiation, derivatives, numerical-derivation
Last push: 2025-01-27T07:45:25+00:00

## Health v2 (maintenance only)
Score: 24/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 3, release rhythm 8, longevity 100
- inputs: {"age_days": 2967, "days_push": 583, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1952, forks 196 (observed 2026-08-28T04:05:58.364975+00:00)

## What it is
autodiff is a C++17 library for automatic differentiation that computes derivatives of functions efficiently using forward mode (dual numbers) and reverse mode (expression trees). It lets developers obtain gradients with minimal code changes, typically by swapping double for autodiff types.

## Use cases
- compute derivatives of C++ functions automatically
- calculate gradients for optimization in C++
- evaluate partial derivatives with forward mode autodiff
- use reverse mode automatic differentiation in C++
- replace finite-difference derivative approximations with exact autodiff
- compute Jacobians and gradients for scientific computing

## When to choose
- you need exact derivatives in C++ without hand-coding derivative formulas
- you want a lightweight, header-friendly C++17 alternative to frameworks like Enzyme or ADOL-C
- you need both forward and reverse mode differentiation in one library

## When to avoid
- you need GPU-accelerated autodiff for large neural network training
- your project is not C++ or requires Python-first tooling like PyTorch or JAX
- you need higher-order tensor operations beyond derivative computation

## Facets
- artifact type: library
- maturity: active
- function: math, machine-learning
- domain: machine-learning, developer-tools
- platform: cpp, cross-platform, windows
- tags: automatic-differentiation, forward-mode, reverse-mode, dual-numbers, c++17, header-only, numerical-derivatives, gradient-computation, algorithms, linux, macos

## Member repositories
- autodiff/autodiff (main) score 24

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:58.364975+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:06:35.366880+00:00, confidence not recorded.
  - readme: https://github.com/autodiff/autodiff (fetched 2026-08-28T04:05:58.364975+00:00, sha e05ef96530c8)
  - homepage: https://autodiff.github.io (fetched 2026-08-29T10:46:19.047060+00:00, sha cfe26f0c019d)
- Data as of 2026-08-30T08:39:29.467469+00:00.
