Intra-procedural Optimization of the Numerical Accuracy of Programs

  • Nasrine Damouche
  • Matthieu Martel
  • Alexandre Chapoutot
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9128)

Abstract

Numerical programs performing floating-point computations are very sensitive to the way formulas are written. These last years, several techniques have been proposed concerning the transformation of arithmetic expressions in order to improve their accuracy and, in this article, we go one step further by automatically transforming larger pieces of code containing assignments and control structures. We define a set of transformation rules allowing the generation, under certain conditions and in polynomial time, of larger expressions by performing limited formal computations, possibly among several iterations of a loop. These larger expressions are better suited to improve the numerical accuracy of the target variable. We use abstract interpretation-based static analysis techniques to over-approximate the roundoff errors in programs and during the transformation of expressions. A prototype has been implemented and experimental results are presented concerning classical numerical algorithm analysis and algorithm for embedded systems.

Keywords

Program transformation Floating-point numbers Static analysis IEEE754 standard 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    ANSI/IEEE. IEEE Standard for Binary Floating-Point Arithmetic. SIAM (2008)Google Scholar
  2. 2.
    Appel, A.-W.: Modern Compiler Implementation in ML. Cambridge University Press (1998)Google Scholar
  3. 3.
    Barr, E.-T., Vo, T., Le, V., Su, Z.: Automatic detection of floating-point exceptions. In: Symposium on Principles of Programming Languages, POPL 2013, pp. 549–560. ACM (2013)Google Scholar
  4. 4.
    Benz, F., Hildebrandt, A., Hack, S.: A dynamic program analysis to find floating-point accuracy problems. In: Programming Language Design and Implementation, PLDI 2012, pp. 453–462. ACM (2012)Google Scholar
  5. 5.
    Bertrane, J., Cousot, P., Cousot, R., Feret, F., Mauborgne, L., Miné, A., Rival, X.: Static analysis by abstract interpretation of embedded critical software. ACM SIGSOFT Software Engineering Notes 36(1), 1–8 (2011)CrossRefGoogle Scholar
  6. 6.
    Chapoutot, A., Damouche, N., Martel, M.: Automatic transformation of a PID controller. In: International Workshop on Numerical Software Verification (2014)Google Scholar
  7. 7.
    Cousot, P., Cousot, R.: Abstract interpretation: A unified lattice model for static analysis of programs by construction or approximation of fixpoints. In: Principles of Programming Languages, pp. 238–252 (1977)Google Scholar
  8. 8.
    Cousout, P., Cousot, R.: Systematic design of program transformation frameworks by abstract interpretation. In: Principles of Programming Languages, pp. 178–190. ACM (2002)Google Scholar
  9. 9.
    Cytron, R., Gershbein, R.: Efficient accomodation of may-alias information in SSA form. In: Programming Language Design and Implementation (PLDI), pp. 36–45. ACM (1993)Google Scholar
  10. 10.
    Delmas, D., Goubault, E., Putot, S., Souyris, J., Tekkal, K., Védrine, F.: Towards an industrial use of FLUCTUAT on safety-critical avionics software. In: Alpuente, M., Cook, B., Joubert, C. (eds.) FMICS 2009. LNCS, vol. 5825, pp. 53–69. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  11. 11.
    Feron, E.: From control systems to control software. IEEE Control Systems Magazine 30(6), 50–71 (2010)CrossRefMathSciNetGoogle Scholar
  12. 12.
    Gao, X., Bayliss, S., Constantinides, G.-A.: SOAP: structural optimization of arithmetic expressions for high-level synthesis. In: Field-Programmable Technology, FPT, pp. 112–119. IEEE (2013)Google Scholar
  13. 13.
    Goubault, E.: Static analysis by abstract interpretation of numerical programs and systems, and FLUCTUAT. In: Logozzo, F., Fähndrich, M. (eds.) SAS 2013. LNCS, vol. 7935, pp. 1–3. Springer, Heidelberg (2013)CrossRefGoogle Scholar
  14. 14.
    Goubault, E., Putot, S.: Static analysis of finite precision computations. In: Jhala, R., Schmidt, D. (eds.) VMCAI 2011. LNCS, vol. 6538, pp. 232–247. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  15. 15.
    Hankin, E.: Lambda Calculi A Guide For Computer Scientists. Clarendon Press, Oxford (1994)MATHGoogle Scholar
  16. 16.
    Ioualalen, A., Martel, M.: A new abstract domain for the representation of mathematically equivalent expressions. In: Miné, A., Schmidt, D. (eds.) SAS 2012. LNCS, vol. 7460, pp. 75–93. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  17. 17.
    Ioualalen, A., Martel, M.: Synthesizing accurate floating-point formulas. In: Application-Specific Systems, Architectures and Processors, ASAP, pp. 113–116 (2013)Google Scholar
  18. 18.
    Jones, N.-D.: An introduction to partial evaluation. ACM Computing Surveys 28(3), 480–503 (1996)CrossRefGoogle Scholar
  19. 19.
    Kendall, A.: An Introduction to Numerical Analysis. John Wiley & Sons (1989)Google Scholar
  20. 20.
    Logozzo, F., Ball, T.: Modular and verified automatic program repair. In: Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA, pp. 133–146. ACM (2012)Google Scholar
  21. 21.
    Martel, M.: Accurate evaluation of arithmetic expressions (invited talk). Electr. Notes Theor. Comput. Sci. 287, 3–16 (2012)CrossRefGoogle Scholar
  22. 22.
    Martel, M.: Semantics of roundoff error propagation in finite precision calculations. Higher-Order and Symbolic Computation 19(1), 7–30 (2006)CrossRefMATHGoogle Scholar
  23. 23.
    Muller, J.-M., Brisebarre, N., De Dinechin, F., Jeannerod, C.-P., Lefèvre, V., Melquiond, G., Revol, N., Stehlé, D., Torres, S.: Handbook of Floating-Point Arithmetic. Birkhäuser (2010)Google Scholar
  24. 24.
    Tate, R., Stepp, M., Tatlock, Z., Lerner, S.: Equality saturation: A new approach to optimization. Logical Methods in Computer Science 7(1) (2011)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2015

Authors and Affiliations

  • Nasrine Damouche
    • 1
    • 2
  • Matthieu Martel
    • 1
    • 2
  • Alexandre Chapoutot
    • 3
  1. 1.DALI Team-ProjectUniversity of Perpignan Via DomitiaPerpignanFrance
  2. 2.University of Montpellier II and CNRS, LIRMM, UMRMontpellierFrance
  3. 3.ENSTA ParisTechPalaiseauFrance

Personalised recommendations