Seasons's Greetings by AD

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
1. Verfasser: Naumann, Uwe
Format: Preprint
Veröffentlicht: 2023
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866917085014130688
author Naumann, Uwe
author_facet Naumann, Uwe
contents We use Algorithmic Differentiation (AD) to implement type-generic tangent and adjoint versions of $$ y=\sum_{i=0}^{n-1} x_{2 i} \cdot x_{2 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=\frac{1}{6} \cdot \sum_{i=0}^{n-1} x^3_{i} $$ 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.
format Preprint
id arxiv_https___arxiv_org_abs_2402_09409
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle Seasons's Greetings by AD
Naumann, Uwe
Computational Engineering, Finance, and Science
00-02
We use Algorithmic Differentiation (AD) to implement type-generic tangent and adjoint versions of $$ y=\sum_{i=0}^{n-1} x_{2 i} \cdot x_{2 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=\frac{1}{6} \cdot \sum_{i=0}^{n-1} x^3_{i} $$ 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.
title Seasons's Greetings by AD
topic Computational Engineering, Finance, and Science
00-02
url https://arxiv.org/abs/2402.09409