AD in Fortran, Part 1: Design

We propose extensions to Fortran which integrate forward and reverse Automatic Differentiation (AD) directly into the programming model. Irrespective of implementation technology, embedding AD constructs directly into the language extends the reach and convenience of AD while allowing abstraction of concepts of interest to scientific-computing practice, such as root finding, optimization, and finding equilibria of continuous games. Multiple different subprograms for these tasks can share common interfaces, regardless of whether and how they use AD internally. A programmer can maximize a function F by calling a library maximizer, XSTAR=ARGMAX(F,X0), which internally constructs derivatives of F by AD, without having to learn how to use any particular AD tool. We illustrate the utility of these extensions by example: programs become much more concise and closer to traditional mathematical notation. A companion paper describes how these extensions can be implemented by a program that generates input to existing Fortran-based AD tools.

[1]  Barak A. Pearlmutter,et al.  Using Programming Language Theory to Make Automatic Differentiation Sound and Efficient , 2008 .

[2]  Jr. Guy L. Steele,et al.  Rabbit: A Compiler for Scheme , 1978 .

[3]  Barak A. Pearlmutter,et al.  Putting the Automatic Back into AD:Part I, What’s Wrong (CVS: 1.1) , 2008 .

[4]  Philip Wadler,et al.  The Glasgow Haskell Compiler: a technical overview , 1993 .

[5]  Christian H. Bischof,et al.  ADIC: An Extensible Automatic Differentiation Tool for ANSI-C , 1997, Softw. Pract. Exp..

[6]  Laurent Hascoët,et al.  TAPENADE 2.1 user's guide , 2004 .

[7]  Peyton Jones,et al.  Haskell 98 language and libraries : the revised report , 2003 .

[8]  B. Speelpenning Compiling Fast Partial Derivatives of Functions Given by Algorithms , 1980 .

[9]  Andreas Griewank,et al.  ADIFOR - Generating Derivative Codes form Fortran Programs , 1992, Sci. Program..

[10]  Barak A. Pearlmutter,et al.  AD in Fortran, Part 2: Implementation via Prepreprocessor , 2012, ArXiv.

[11]  John McCarthy,et al.  Recursive functions of symbolic expressions and their computation by machine, Part I , 1959, Commun. ACM.

[12]  Uwe Naumann,et al.  Computing Adjoints with the NAGWare Fortran 95 Compiler , 2006 .

[13]  A. Church The calculi of lambda-conversion , 1941 .

[14]  R. E. Wengert,et al.  A simple automatic derivative evaluation program , 1964, Commun. ACM.

[15]  CarleAlan,et al.  ADIFOR-Generating Derivative Codes from Fortran Programs , 1992 .

[16]  Christian Bischof,et al.  ADIC: an extensible automatic differentiation tool for ANSI-C , 1997 .

[17]  Barak A. Pearlmutter,et al.  Using Polyvariant Union-Free Flow Analysis to Compile aHigher-Order Functional-Programming Language with aFirst-Class Derivative Operator to Efficient Fortran-like Code , 2008 .