Skip to main content
Log in

Functional Differentiation of Computer Programs

  • Published:
Higher-Order and Symbolic Computation

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Abramowitz, M. and Stegun, I. (Eds). Handbook of Mathematical Functions. Dover Publications, 1970.

  2. Bender, C. and Orszag, S. Advanced Mathematical Methods for Scientists and Engineers. McGraw-Hill, 1978.

  3. 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.

    Google Scholar 

  4. 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.

  5. Bourbaki, N. Algebra. Springer, 1989.

  6. 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.

    Google Scholar 

  7. 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].

  8. Giering, R. and Kaminski, T. Recipes for adjoint code construction. ACM Transactions on Math. Software, 24(4) (1998) 437-474.

    Google Scholar 

  9. Graham, R., Knuth, D., and Patashnik, O. Concrete Mathematics. Addison-Wesley, Reading, MA, 1989.

    Google Scholar 

  10. 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.

    Google Scholar 

  11. 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.

    Google Scholar 

  12. 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

  13. Kaplansky, I. An Introduction to Differential Algebra. Hermann, Paris, 1957.

    Google Scholar 

  14. Karczmarczuk, J. Functional differentiation of computer programs. In Proceedings, III ACM SIGPLAN International Conference on Functional Programming, Baltimore, 1998, pp. 195-203.

  15. Karczmarczuk, J. Generating power of lazy semantics. Theoretical Computer Science 187 (1997) 203-219.

    Google Scholar 

  16. 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.

  17. Karczmarczuk, J. Functional coding of differential forms. Talk at the First Scottish Workshop on Functional Programming, Stirling, Sept. 1999.

  18. 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.

  19. 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/.

  20. Knuth, D. The Art of Computer Programming, Vol. 2: Seminumerical Algorithms. Addison-Wesley, Reading, 1981.

    Google Scholar 

  21. Rice University PLT software site, http://www.cs.rice.edu/CS/PLT.

  22. Ritt, J. Differential Algebra. Dover, New York, 1966.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints 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

Download citation

  • Issue Date:

  • DOI: https://doi.org/10.1023/A:1011501232197

Navigation