Skip to main content
Log in

Improving the numerical accuracy of programs by automatic transformation

  • FMICS 2015/2016
  • Published:
International Journal on Software Tools for Technology Transfer Aims and scope Submit manuscript

Abstract

The dangers of programs performing floating-point computations are well known. This is due to the sensitivity of the results to the way formulæ are written. These last years, several techniques have been proposed concerning the transformation of arithmetic expressions in order to improve their numerical 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, by reparsing, the numerical accuracy of the program results. We use abstract interpretation-based static analysis techniques to over-approximate the round-off errors in programs and during the transformation of expressions. A tool has been implemented and experimental results are presented concerning classical numerical algorithms and algorithms for embedded systems.

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.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9

Similar content being viewed by others

References

  1. Almagor, L., Cooper, K.D., Grosul, A., Harvey, T.J., Reeves, S.W., Subramanian, D., Torczon, L., Waterman, T.: Finding effective compilation sequences. In: Whalley D.B., Cytron, R. (eds.) ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools for Embedded Systems (LCTES’04), pp. 231–239. ACM (2004)

  2. ANSI/IEEE. IEEE Standard for Binary Floating-point Arithmetic, std 754-2008 edition (2008)

  3. Appel, A.-W.: Modern compiler implementation in ML. Cambridge University Press, Cambridge (1998)

    MATH  Google Scholar 

  4. Barr, E.T., Vo, T., Le, V., Su, Z.: Automatic detection of floating-point exceptions. In: Giacobazzi, R., Cousot, R. (eds.) ACM SIGPLAN-SIGACT POPL’13, pp. 549–560, ACM (2013)

  5. Benz, F., Hildebrandt, A., Hack, S.: A dynamic program analysis to find floating-point accuracy problems. In: Vitek, J., Lin, H., Tip, F. (eds.) ACM SIGPLAN PLDI’12, pp. 453–462. ACM (2012)

  6. Bertrane, J., Cousot, P., Cousot, R., Feret, J., Mauborgne, L., Miné, A., Rival, X.: Static analysis by abstract interpretation of embedded critical software. ACM SIGSOFT Softw. Eng. Notes 36(1), 1–8 (2011)

    Article  Google Scholar 

  7. Cooper, K.D., Subramanian, D., Torczon, L.: Adaptive optimizing compilers for the 21st century. J. Supercomput. 23(1), 7–22 (2002)

    Article  MATH  Google Scholar 

  8. Cousot, P., Cousot, R.: Abstract interpretation: A unified lattice model for static analysis of programs by construction or approximation of fixpoints. In: Graham, R.M., Harrison, M.A., Sethi, R. (eds.) POPL’77, pp. 238–252 ACM (1977)

  9. Cousot, P., Cousot, R.: Systematic design of program transformation frameworks by abstract interpretation. In: Launchbury, J., Mitchell, J.C. (eds.) POPL’02, pp. 178–190. ACM (2002)

  10. Cytron, R., Gershbein, R.: Efficient accomodation of may-alias information in SSA form. In PLDI’93, pp. 36–45, ACM (1993)

  11. Damouche, N., Martel, M., Chapoutot, A.: Impact of accuracy optimization on the convergence of numerical iterative methods. In: Falaschi, M. (ed.) LOPSTR 2015, volume 9527 of Lecture Notes in Computer Science, pp. 143–160. Springer (2015)

  12. Damouche, N., Martel, M., Chapoutot, A.: Intra-procedural optimization of the numerical accuracy of programs. In M. Núñez and M. Güdemann, editors, FMICS’15, volume 9128 of Lecture Notes in Computer Science, pp. 31–46 Springer (2015)

  13. Damouche, N., Martel, M., Chapoutot, A.: Optimizing the accuracy of a rocket trajectory simulation by program transformation. In: CF’15, pp. 40:1–40:2. ACM (2015)

  14. Damouche, N., Martel, M., Chapoutot, A.: Transformation of a PID controller for numerical accuracy. Electr. Notes Theor. Comput. Sci. 317, 47–54 (2015)

    Article  MathSciNet  MATH  Google Scholar 

  15. Darulova, E., Kuncak, V.: Sound compilation of reals. In: Jagannathan, S., Sewell, P. (eds.) POPL’14, pp. 235–248. ACM (2014)

  16. 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: FMICS’09, pp. 53–69 (2009)

  17. Feron, E.: From control systems to control software, ieee control systems magazine. IEEE 30, 50–71 (2010)

    MathSciNet  Google Scholar 

  18. Goubault E.: Static analysis by abstract interpretation of numerical programs and systems, and FLUCTUAT. In: Logozzo, F., Fähndrich, M. (eds.) SAS’13, volume 7935 of Lecture Notes in Computer Science, pp. 1–3. Springer (2013)

  19. Goubault E., Putot S.: Static analysis of finite precision computations. In: Jhala, R., Schmidt, D.A. (eds.) VMCAI’11, volume 6538 of Lecture Notes in Computer Science, pp. 232–247. Springer (2011)

  20. Feret, J.: Static analysis of digital filters. In: Schmidt, D.A. (ed.) Programming Languages and Systems, 13th European Symposium on Programming, ESOP 2004, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS, volume 2986 of Lecture Notes in Computer Science, pp. 33–48. Springer (2004)

  21. Gao, X., Bayliss, S., G. A. Constantinides. SOAP: structural optimization of arithmetic expressions for high-level synthesis. In: FPT’13, pp. 112–119. IEEE (2013)

  22. Hankin, E.: Lambda Calculi A guide for computer scientists. Clarendon Press, Oxford (1994)

    MATH  Google Scholar 

  23. Huet, G., Kahn, G., Paulin-Mohring, Ch.: The \(\sf Coq\) ProofAssistant—A tutorial-Version 8.0, (2004)

  24. Ioualalen, A., Martel, M.: A new abstract domain for the representation of mathematically equivalent expressions. In: SAS’12, volume 7460 of LNCS, pp. 75–93. Springer (2012)

  25. Jones, N.D.: An introduction to partial evaluation. ACM Comput. Surv. 28(3), 480–503 (1996)

    Article  Google Scholar 

  26. Kendall, A.: An introduction to numerical analysis. Wiley, Hoboken (1989)

    MATH  Google Scholar 

  27. Knoop, J., R”uthing, O., Steffen, B.: Optimal code motion: Theory and practice. ACM Transactions on Programming Languages and Syst. 16(4):1117–1155 (1994)

  28. Langlois, P., Martel, M., Thévenoux, L.: Accuracy versus time: a case study with summation algorithms. In: Maza, M.M., Roch, J.-L. (eds) 4th International Workshop on Parallel Symbolic Computation, PASCO, pp. 121–130. ACM (2010)

  29. Lerner, S., Grove, D., Chambers, C.: Composing dataflow analyses and transformations. In: Launchbury, J., Mitchell, J.C. (eds) 29th SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 270–282. ACM (2002)

  30. Martel, M.: Semantics of roundoff error propagation in finite precision calculations. High. Order Symb. Comput. 19(1), 7–30 (2006)

    Article  MATH  Google Scholar 

  31. Martel, M.: Accurate evaluation of arithmetic expressions (invited talk). Electr. Notes Theor. Comput. Sci. 287, 3–16 (2012)

    Article  MATH  Google Scholar 

  32. Miné, A.: Relational abstract domains for the detection of floating-point run-time errors. In D. A. Schmidt, editor, Programming Languages and Systems, 13th European Symposium on Programming, ESOP 2004, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2004, Proceedings, volume 2986 of Lecture Notes in Computer Science, p. 3–17. Springer (2004)

  33. Monniaux, D.: The pitfalls of verifying floating-point computations. ACM Trans. Program. Lang. Syst. 30(3) 2008

  34. 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. B. Boston (2010)

  35. Wilcox, J. R., Panchekha, P., Sanchez-Stern, A., Tatlock, Z.: Automatically improving accuracy for floating point expressions. In: Grove, D., Blackburn, S. (eds.) ACM SIGPLAN PLDI’2015, pp. 1–11. ACM (2015)

  36. Solovyev, A., Jacobsen, C., Rakamaric, Z., Gopalakrishnan, G.: Rigorous estimation of floating-point round-off errors with symbolic taylor expansions. In FM’15, volume 9109 of LNCS, pp. 532–550. Springer (2015)

  37. Steffen, B., Knoop, J., Rüthing, O.: The value flow graph: a program representation for optimal program transformations. In: Jones, N.D. (ed.) ESOP’90, 3rd European Symposium on Programming, volume 432 of Lecture Notes in Computer Science, pp. 389–405. Springer (1990)

  38. Tate, R., Stepp, M., Tatlock, Z., Lerner, S.: Equality saturation: a new approach to optimization. In Z. Shao and B. C. Pierce, editors, ACM SIGPLAN-SIGACT POPL’09, pages 264–276. ACM, (2009)

  39. Tate, R., Stepp, M., Tatlock, Z., Lerner, S.: Equality saturation: a new approach to optimization. Logical Methods in Computer Science 7(1) (2011)

  40. Whitfield, D., Lou Soffa, M.: An approach for exploring code-improving transformations. ACM Trans. Program. Lang. Syst. 19(6), 1053–1084 (1997)

    Article  Google Scholar 

  41. Winskel, G.: The formal semantics of programming languages - an introduction. Foundation of computing series. MIT Press, Cambridge (1993)

    MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Nasrine Damouche.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Damouche, N., Martel, M. & Chapoutot, A. Improving the numerical accuracy of programs by automatic transformation. Int J Softw Tools Technol Transfer 19, 427–448 (2017). https://doi.org/10.1007/s10009-016-0435-0

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10009-016-0435-0

Keywords

Navigation