Transformations of numerical source code may require the augmentation of the original variables with new data to represent additional data the transformed program operates on. Automatic differentiation makes extensive use of this concept. We describe the two principal approaches to implement the variable augmentation, complete encapsulation and complete separation. The paper concentrates on two major aspects. First, we characterize the advantages of each approach and illustrate the effort needed to realize these advantages in Fortran, C, and C++ as the languages we are most interested in. Second, we discuss the practical solutions that in effect represent hybrids of the two approaches. 1
Michael W. Fagan, Laurent Hascoët, Jean Utke