Seasons's Greetings by AD
Abstract
We use Algorithmic Differentiation (AD) to implement type-generic tangent and adjoint versions of y=Σi=0n-1 x2 i · x2 i+1 in C++. We run an instantiation for char-arithmetic and we print the gradient at (101~77~114~114~32~121~109~88~115~97)T to std::cout, yielding the output ``Merry Xmas''. Similar instantiations of type-generic second-order tangent and second-order adjoint versions of y=16 · Σi=0n-1 x3i yield ``Happy 2026'' at (72~97~112~112~121~32~50~48~50~54)T. Prepend a sufficiently large number of zeros to the input vector to explore the varying run times of the different derivative codes. The entire source code can be found on https://github.com/un110076/SeasonsGreetings.
Turn this paper into a full lesson
ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.