Adjoint Codes in Functional Framework
Jerzy Karczmarczuk · 2000
We show how to implement functionally the reverse, or adjoint strategy within the domain of Computational Dierentiation techniques { tools permitting to compute numerically, but exactly (i.e. up to the machine precision) the derivatives of coded functions. The imperative coding of the reverse techniques is awkward. It requires the reversal of the control thread of the program, and it recomputes the derivatives through the adjoint statements beginning with the denition of the nal result, and ending at the independent variables. Usually a special external data structure, the \\tape" is used to store the adjoint statements. It is created during the \\forward" stage of the program, and then interpreted backwards. We show how to construct purely functionally the equivalent of such a tape, but we present also a more interesting model based on a variant of Wadler's backward propagating State Transformer monad. Our package, written in Haskell, uses the overloading of standard arithmetic opera...