Partial Evaluation of MATLAB

  • Daniel Elphick
  • Michael Leuschel
  • Simon Cox
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2830)


We describe the problems associated with the creation of high performance code for mathematical computations. We discuss the advantages and disadvantages of using a high level language like MATLAB and then propose partial evaluation as a way of lessening the disadvantages at little cost. We then go on to describe the design of a partial evaluator for MATLAB and present results showing what performance increases can be achieved and the circumstances in which partial evaluation can provide these.


Function Call Partial Evaluation Conditional Statement Parse Tree High Level Language 
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.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Almási, G.: MaJIC: A MATLAB Just-In-Time Compiler. PhD thesis, University of Illinois at Urbana-Champaign (2001)Google Scholar
  2. 2.
    Almási, G., Padua, D.: MaJIC: compiling MATLAB for speed and responsiveness. In: Proceeding of the ACM SIGPLAN 2002 Conference on Programming language design and implementation, pp. 294–303. ACM Press, New York (2002)CrossRefGoogle Scholar
  3. 3.
    Andersen, L.O.: Program Analysis and Specialization for the C Programming Language. PhD thesis, DIKU, University of Copenhagen (1994)Google Scholar
  4. 4.
    Cousot, P., Cousot, R.: Abstract interpretation and application to logic programs. Journal of Logic Programming 13(2-3), 103–179 (1992)zbMATHCrossRefMathSciNetGoogle Scholar
  5. 5.
    Elphick, D.: Implementation of a MATLAB partial evaluator. Technical Report DSSE-TR- 2003-4, University of Southampton (2003)Google Scholar
  6. 6.
    Glück, R., Nakashige, R., Zöchling, R.: Binding-time analysis applied to mathematical algorithms. In: System Modelling and Optimization, pp. 137–146. Chapman & Hall, Boca Raton (1995)Google Scholar
  7. 7.
    Jones, N.D., Gomard, C.K., Sestoft, P.: Partial Evaluation and Automatic Program Generation. Prentice Hall, Englewood Cliffs (1993)zbMATHGoogle Scholar
  8. 8.
    Kleinrubatscher, P., Kriegshaber, A., Zöchling, R., Glück, R.: Fortran program specialization. In: Snelting, G., Meyer, U. (eds.) Semantikgestützte Analyse, Entwicklung und Generierung von Programmen. GI Workshop, Schloss Rauischholzhausen, Germany, pp. 45–54 (1994) Justus-Liebig-Universität GiessenGoogle Scholar
  9. 9.
    Knoop, J., Ruthing, O., Steffen, B.: Partial dead code elimination. In: SIGPLAN Conference on Programming Language Design and Implementation, pp. 147–158. ACM Press, New York (1994)Google Scholar
  10. 10.
    Leuschel, M., Bruynooghe, M.: Logic program specialisation through partial deduction: Control issues. Theory and Practice of Logic Programming 2(4 & 5), 461–515 (2002)zbMATHCrossRefMathSciNetGoogle Scholar
  11. 11.
  12. 12.
    Menon, V., Trefethen, A.E.: MultiMATLAB: Integrating Matlab with high performance parallel computing. In: Supercomputing 1997. ACM SIGARCH and IEEE Computer Society, pp. 1–18 (1997)Google Scholar
  13. 13.
    Mogensen, T.Æ., Sestoft, P.: Partial evaluation. In: Kent, A., Williams, J.G. (eds.) Encyclopedia of Computer Science and Technology, vol. 37, pp. 247–279. Marcel Dekker, 270 Madison Avenue (1997)Google Scholar
  14. 14.
    Muchnick, S.: Advanced Compiler Design & Implementation. Morgan Kaufmann Publishers, San Francisco (1997)Google Scholar
  15. 15.
    Pawletta, S., Pawletta, T., Drewelow, W., Duenow, P., Suesse, M.: A MATLAB toolbox for distributed and parallel processing. In: Moler, C., Little, S. (eds.) Proc. of the Matlab Conference 1995, Cambridge, MA, October 1995, MathWorks Inc. (1995)Google Scholar
  16. 16.
    Quinn, M., Malishevsky, A., Seelam, N., Zhao, Y.: Preliminary results from a parallel MATLAB compiler. In: International Parallel Processing Symposium, pp. 81–87. IEEE CS Press, Los Alamitos (1998)Google Scholar
  17. 17.
    Rose, L.D.: Compiler techniques for MATLAB programs. Technical Report UIUCDCS-R-96-1956, University of Illinois at Urbana-Champaign (1996)Google Scholar
  18. 18.
    Rose, L.D., Gallivan, K., Gallopoulos, E., Marsolf, B.A., Padua, D.A.: FALCON: A MATLAB interactive restructuring compiler. In: Languages and Compilers for Parallel Computing, pp. 269–288. Springer, Heidelberg (1995)Google Scholar
  19. 19.
    Schultz, U.P., Lawall, J.L., Consel, C., Muller, G.: Towards automatic specialization of Java programs. In: Guerraoui, R. (ed.) ECOOP 1999. LNCS, vol. 1628, pp. 367–390. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  20. 20.
    The MathWorks, Inc. - About Us.,
  21. 21.
    Whaley, R.C., Petitet, A., Dongarra, J.J.: Automated empirical optimizations of software and the ATLAS project. Parallel Computing 27(1-2), 3–35 (2001)zbMATHCrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2003

Authors and Affiliations

  • Daniel Elphick
    • 1
  • Michael Leuschel
    • 1
  • Simon Cox
    • 2
  1. 1.Department of Electronics and Computer Science 
  2. 2.School of Engineering SciencesUniversity of SouthamptonHighfield, SouthamptonUK

Personalised recommendations