Source Transformation for MATLAB Automatic Differentiation

  • Rahul V. Kharche
  • Shaun A. Forth
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3994)


We present MSAD, a source transformation implementation of forward mode automatic differentiation for MATLAB. MSAD specialises and inlines operations from the fmad and derivvec classes of the MAD package. The operator overloading overheads inherent in MAD are eliminated while preserving the derivvec class’s optimised derivative combination operations. Compared to MAD, results from several test cases demonstrate significant improvement in efficiency across all problem sizes.


Problem Size Storage Type Forward Mode Derivative Computation Increase Problem Size 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


  1. 1.
    Griewank, A.: Evaluating Derivatives: Principles and Techniques of Algorithmic Differentiation, 19th edn. Frontiers in Appl. Math. SIAM, Philadelphia (2000)MATHGoogle Scholar
  2. 2.
    Coleman, T.F., Verma, A.: ADMAT: An automatic differentiation toolbox for MATLAB. Technical report, Computer Science Department, Cornell University (1998)Google Scholar
  3. 3.
    Bischof, C.H., Bücker, H.M., Lang, B., Rasch, A., Vehreschild, A.: Combining source transformation and operator overloading techniques to compute derivatives for MATLAB programs. In: Proceedings of the Second IEEE International Workshop on Source Code Analysis and Manipulation (SCAM 2002), pp. 65–72. IEEE Computer Society, Los Alamitos (2002)CrossRefGoogle Scholar
  4. 4.
    Forth, S.A.: An efficient overloaded implementation of forward mode automatic differentiation in MATLAB. Accepted ACM Trans. Math. Softw. (2005)Google Scholar
  5. 5.
    Parr, T., Quong, R.: ANTLR: A predicated LL(k) parser generator. Software, Practice and Experience 25, 789 (1995)CrossRefGoogle Scholar
  6. 6.
    Kharche, R.V.: Source transformation for automatic differentiation in MATLAB. Master’s thesis, Cranfield University (Shrivenham Campus), Engineering Systems Dept., Shrivenham, Swindon SN6 8LA, UK (2004)Google Scholar
  7. 7.
    Bischof, C.H., Carle, A., Khademi, P., Mauer, A.: ADIFOR 2.0: Automatic Differentiation of Fortran 77 Programs. IEEE Computational Science & Engineering 3(3), 18–32 (1996)CrossRefGoogle Scholar
  8. 8.
    Menon, V., Pingali, K.: A case for source-level transformations in MATLAB. In: PLAN 1999: Proceedings of the 2nd conference on Domain-specific languages, pp. 53–65. ACM Press, New York (1999)CrossRefGoogle Scholar
  9. 9.
    Rose, L.D., Padua, D.: Techniques for the translation of MATLAB programs into Fortran 90. ACM Trans. Program. Lang. Syst. 21(2), 286–323 (1999)CrossRefGoogle Scholar
  10. 10.
    Elphick, D., Leuschel, M., Cox, S.: Partial evaluation of MATLAB. In: GPCE 2003: Proceedings of the second international conference on Generative programming and component engineering, pp. 344–363. Springer, New York (2003)Google Scholar
  11. 11.
    The MathWorks Inc. 24 Prime Park Way, Natick, MA 01760-1500: MATLAB Optimization Toolbox - User’s guide (2005)Google Scholar
  12. 12.
    Averick, B.M., Moré, J.J.: User guide for the MINPACK-2 test problem collection. Technical Memorandum ANL/MCS-TM-157, Argonne National Laboratory, Argonne, Ill (1991), Also issued as Preprint 91-101 of the Army High Performance Computing Research Center at the University of MinnesotaGoogle Scholar
  13. 13.
    Lenton, K.: An efficient, validated implementation of the MINPACK-2 test problem collection in MATLAB. Master’s thesis, Cranfield University (Shrivenham Campus), Engineering Systems Dept., Shrivenham, Swindon SN6 8LA, UK (2005)Google Scholar
  14. 14.
    Kharche, R., Forth, S.: Source transformation for MATLAB automatic differentiation. Applied Mathematics & Operational Research Report AMOR 2005/1, Cranfield University (Shrivenham Campus), Engineering Systems Dept., Shrivenham, Swindon, SN6 8LA, UK (2005)Google Scholar
  15. 15.
    Bouaricha, A., Moré, J.J., Wu, Z.: Newton’s method for large-scale optimization. Preprint MCS-P635-0197, Argonne National Laboratory, Argonne, Illinois (1997)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Rahul V. Kharche
    • 1
  • Shaun A. Forth
    • 1
  1. 1.Cranfield UniversitySwindonUK

Personalised recommendations