Abstract
We present a purely functional implementation of the computational differentiation tools—the well known numeric (i.e., not symbolic) techniques which permit one to compute point-wise derivatives of functions defined by computer programs economically and exactly (with machine precision). We show how the use of lazy evaluation permits a transparent and elegant construction of the entire infinite tower of derivatives of higher order for any expressions present in the program. The formalism may be useful in various problems of scientific computing which often demand a hard and ungracious human preprocessing before writing the final code. Some concrete examples are given.
Similar content being viewed by others
References
Abramowitz, M. and Stegun, I. (Eds). Handbook of Mathematical Functions. Dover Publications, 1970.
Bender, C. and Orszag, S. Advanced Mathematical Methods for Scientists and Engineers. McGraw-Hill, 1978.
Bendtsen, C. and Stauning, O. TADIFF, a flexible C++ package for automatic differentiation. Tech. Rep. IMM-REP-1997-07, Dept. of Mathematical Modelling, Technical University of Denmark, Lyngby, 1997.
Berz, M., Bischof, C., Corliss, G., and Griewank, A. (Eds.). Computational Differentiation: Techniques, Applications and Tools, Second SIAM InternationalWorkshop on Computational Differentiation. Proceedings in Applied Mathematics 89, 1996.
Bourbaki, N. Algebra. Springer, 1989.
Corless, R., Gonnet, G., Hare, D.E.G., Jeffrey, D.J., and Knuth, D. On the Lambert W function. Advances in Computational Mathematics 5 (1996) 329-359. See also the documentation of the Maple SHARE Library.
Corliss, G. Automatic differentiation bibliography. Originally published in the SIAM Proceedings of Automatic Differentiation of Algorithms: Theory, Implementation and Application, 1991, G. Corliss and A. Griewank (Eds.), but many times updated since then. Available from the netlib archives (www.netlib.org/bib/all-brec.bib) and in other places, e.g. liinwww.ira.uka.de/bibliography/Math/auto.diff.html. See also [4].
Giering, R. and Kaminski, T. Recipes for adjoint code construction. ACM Transactions on Math. Software, 24(4) (1998) 437-474.
Graham, R., Knuth, D., and Patashnik, O. Concrete Mathematics. Addison-Wesley, Reading, MA, 1989.
Griewank, A., Juedes, D., Mitev, H., Utke, J., Vogel, O., and Walther, A. ADOL-C: A package for the automatic differentiation of algorithms written in C/C++. ACM TOMS 22(2) (1996) 131-167. Algorithm 755.
Hovland, P., Bischof, C., Spiegelman, D., and Cosella, M. Efficient derivative codes through automatic differentiation and interface contraction: An application in biostatistics. SIAM J. on Sci. Comp. 18 (1997) 1056-1066.
Jones, M.P. The Hugs 98 User Manual. Available from the Web site http://www.haskell.org/hugs together with the full distribution of Hugs. FUNCTIONAL DIFFERENTIATION OF COMPUTER PROGRAMS 57
Kaplansky, I. An Introduction to Differential Algebra. Hermann, Paris, 1957.
Karczmarczuk, J. Functional differentiation of computer programs. In Proceedings, III ACM SIGPLAN International Conference on Functional Programming, Baltimore, 1998, pp. 195-203.
Karczmarczuk, J. Generating power of lazy semantics. Theoretical Computer Science 187 (1997) 203-219.
Karczmarczuk, J. Functional programming and mathematical objects. In Proceedings, Functional Programming Languages in Education, FPLE'95. Lecture Notes in Computer Science, Vol. 1022, Springer, 1995, pp. 121-137.
Karczmarczuk, J. Functional coding of differential forms. Talk at the First Scottish Workshop on Functional Programming, Stirling, Sept. 1999.
Karczmarczuk, J. Adjoint codes in functional framework. Informal presentation at the Haskell Workshop, Colloquium PLI 2000, Montreal, Sept. 2000. Available from the author: www.info.unicaen.fr/~karczma/arpap/revdiff.pdf.
Kelsey, R. and Clinger,W.R.J. (Eds.). Revised(5) report on the algorithmic language scheme. Available from the Scheme Repository: www.cs.indiana.edu/scheme-repository/.
Knuth, D. The Art of Computer Programming, Vol. 2: Seminumerical Algorithms. Addison-Wesley, Reading, 1981.
Rice University PLT software site, http://www.cs.rice.edu/CS/PLT.
Ritt, J. Differential Algebra. Dover, New York, 1966.
Author information
Authors and Affiliations
Rights and permissions
About this article
Cite this article
Karczmarczuk, J. Functional Differentiation of Computer Programs. Higher-Order and Symbolic Computation 14, 35–57 (2001). https://doi.org/10.1023/A:1011501232197
Issue Date:
DOI: https://doi.org/10.1023/A:1011501232197