Algorithmic Differentiation Cheat Sheet
7 Pages Posted: 24 May 2022 Last revised: 12 Feb 2023
Date Written: May 9, 2022
Abstract
Algorithmic Differentiation (AD), also known as automatic differentiation, computes the derivative(s) of computer code. It was pioneered by (Giles and Glasserman, 2006) and produces exact derivatives with low latency. AD is well presented in finance, see (Capriotti, 2010), (NAG, n.d.) and (Savine,2018), where it can be used to compute financial risks such as Swap DV01, see (Burgess, 2022).
In this paper we summarize (Burgess, 2022) and provide a cheat sheet of how to perform AD by hand. Firstly we present algorithmic differentiation and how to compute the exact derivative(s) of computer code to machine precision. Secondly we give a summary of AD and illustrate how to perform AD by hand using tangent and adjoint calculation modes. Throughout we gave examples in C++ code, which are available for download.
Keywords: Algorithmic Differentiation, Chain-Rule, Tangent Mode, Forwards, Adjoint Mode, Backwards, Reverse, Accuracy, Machine Precision, Low Latency, By Hand, Finance, Risks, Sensitivities
JEL Classification: C02, C63, G00, G12, G15, G20, G32
Suggested Citation: Suggested Citation
