Adjoint automatic differentiation costs a constant multiple of the price no matter how many inputs you have. This page lets you check that — and the case where it returns a derivative of exactly zero and is wrong.
Central differences need 2n+1 pricings for n parameters. A reverse sweep needs one forward pass and one backward pass, whatever n is. Drag the basket size and watch which line bends.
Points are measured at n = 1, 2, 5, 10, 25, 50 (40,000 paths, Apple M-series, best of five). Wall-clock timings move about 10% between runs, so the claim is the shape — flat against linear — not the exact multiple. Beyond those the bumping line follows the 2n+1 model it has already been shown to obey; the AAD line is held at its measured mean multiple. Hover any measured point for its timings.
A bumped derivative trades truncation error against cancellation error, and the crossover moves with the problem. This chart is computed live in your browser from a double-precision Black–Scholes — drag the bump and watch the error find its floor and climb back out.
AAD does not appear on this axis as a curve because it has no bump to tune. It differentiates the program rather than the function, so neither error term exists.
A cash-or-nothing digital pays 1 if the spot finishes above the strike. The payoff is a step, its derivative is zero almost everywhere, and the reverse sweep propagates that faithfully. No error, no NaN, no warning — just a delta of zero.
The payoff is flat everywhere except one point of measure zero. Every path contributes a derivative of 0, so the sum is 0. This is the correct answer to the wrong question.
| method | delta | relative error |
|---|---|---|
| pathwise AAD, sharp payoff | 0.000000 | 100.0% |
| central difference, h = 0.5 | 0.019317 | 0.1% |
| AAD, call-spread smoothing h = 2.0 | 0.019325 | 0.0% |
| AAD, call-spread smoothing h = 1.0 | 0.019341 | 0.0% |
| AAD, call-spread smoothing h = 0.25 | 0.019356 | 0.1% |
Measured, 400,000 paths, common random numbers. The crude method this repository argues against wins outright in this regime, which is why it is on the page rather than in a footnote.
The analytic Greeks are the textbook formulas written by hand. They share no code with the AD engine, which is the only reason agreement means anything.
| greek | AAD | analytic | relative error |
|---|
S = 100, K = 100, r = 3%, σ = 20%, T = 1. The whole closed form is 27 tape nodes. Second-order Greeks are deliberately absent: a Hessian costs one reverse sweep per row, so the flat-cost property above does not extend to them.