Skip to main content
Log in

Interval arithmetic using expression templates, template meta programming and the upcoming C++ standard

  • Published:
Computing Aims and scope Submit manuscript

Abstract

In this paper we will discuss different realizations for an efficient interval arithmetic implementation using expression templates and template meta programming in C++. We will improve the handling of the rounding mode switches using expression templates and show how the constructed expression trees can be combined with other features like automatic differentiation. For a further improvement of the run time performance we try to move as many functionality as possible to the compile time using template meta programming techniques. In addition we will illustrate how an interval arithmetic implementation will profit from new features and keywords defined in the upcoming C++ standard.

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. Alexandrescu A (2001) Modern C++ design: generic programming and design patterns applied. Addison-Wesley Longman Publishing Co. Inc., Boston

    Google Scholar 

  2. Aubert P, Di Césaré N, Pironneau O (2001) Automatic differentiation in C++ using expression templates and application to a flow control problem. Comput Vis. Sci. 3: 197–208

    Article  MATH  Google Scholar 

  3. Becker P (2011) Working Draft, Standard for Programming Language C++. Tech. Rep. N3242=11-0012, ISO/IEC JTC1/SC22/WG21

  4. Bendtsen C, Stauning O (1996) FADBAD, a flexible C++ package for automatic differentiation. Technical Report IMM–REP–1996–17, Department of Mathematical Modelling. Technical University of Denmark, Lyngby, Denmark

    Google Scholar 

  5. Bischof CH, Bücker HM (2000) Computing derivatives of computer programs. In: Grotendorst J (ed) Modern methods and algorithms of quantum chemistry: proceedings, 2nd edn. NIC Series, vol 3, pp 315–327. NIC-Directors, Jülich

  6. Bischof CH, Roh L, Mauer A (1997) ADIC—An extensible automatic differentiation tool for ANSI-C. Softw Pract Exp 27(12): 1427–1456

    Article  Google Scholar 

  7. Boost Interval Arithmetic Library (2011). http://www.boost.org/doc/libs/1_46_1/libs/numeric/interval/doc/interval.htm

  8. Corliss GF, Griewank A (1993) Operator Overloading as an Enabling Technology for Automatic Differentiation. Tech. Rep. CRPC-TR93431, Center for Research on Parallel Computation. Rice University, Houston

    Google Scholar 

  9. CRlibm-Correctly Rounded mathematical library (2011). http://lipforge.ens-lyon.fr/www/crlibm/

  10. Daramy-Loirat C, Defour D, de Dinechin F, Gallet M, Gast N, Quirin Lauter C, Muller JM (2009) CR-LIBM A library of correctly rounded elementary functions in double-precision. http://lipforge.ens-lyon.fr/frs/download.php/153/crlibm-1.0beta3.pdf

  11. Gil J, Gutterman Z (1998) Compile time symbolic derivation with C++ templates. In: Proceedings of the 4th conference on USENIX conference on object-oriented technologies and systems, vol 4, COOTS’98, pp 18–18. USENIX Association, Berkeley

  12. Gregor D, Järvi J, Powell G (2006) Variadic templates (revision 3). Tech. Rep. N2080=06-0150, ISO/IEC JTC1/SC22/WG21

  13. Griewank A, Juedes D, Utke J (1996) Algorithm 755: ADOL-C: a package for the automatic differentiation of algorithms written in C/C++. ACM Trans Math Softw 22(2): 131–167

    Article  MATH  Google Scholar 

  14. Hammer R, Ratz D, Kulisch U, Hocks M (1997) C++ Toolbox for Verified Computing I: Basic Numerical Problems. Springer-Verlag New York Inc., Secaucus

    Google Scholar 

  15. Hascoët L, Pascual V (2004) TAPENADE 2.1 user’s guide. Rapport technique 300, INRIA, Sophia Antipolis

  16. Järvi J, Stroustrup B, Reis GD (2004) Decltype and auto (revision 4). Tech. Rep. N1705=04-0145, ISO/IEC JTC1/SC22/WG21

  17. Lambov B (2008) Interval arithmetic using SSE-2. Lecture Notes in Computer Science, vol 5045, pp 102–113

  18. Lerch M, Tischler G, Wolff von Gudenberg J, Hofschuster W, Krämer W (2006) Filib++, a fast interval library supporting containment computations. ACM Trans Math Softw 32(2): 299–324

    Article  Google Scholar 

  19. Myers N (1995) A new and useful template technique: traits. C++ Report 7(5):32–35. Reprinted in Lippman SB (ed) 1996 C++ Gems. SIGS publications, Inc., New York, NY, USA

  20. Nehmeier M, Wolff von Gudenberg J (2011) filib++, Expression Templates and the Coming Interval Standard. Reliab Comput 15(4): 312–320

    MathSciNet  Google Scholar 

  21. Rall LB (1981) Automatic differentiation: techniques and applications. Lecture Notes in Computer Science, vol 120. Springer, Berlin

  22. Veldhuizen T (1995) Expression templates. C++ Report 7(5):26–31. Reprinted in Lippman SB (ed) 1996 C++ Gems. SIGS publications, Inc., New York, NY, USA

  23. Veldhuizen T (1995) Using C++ template metaprograms. C++ Report 7(4):36–43. Reprinted in Lippman SB (ed) 1996 C++ Gems. SIGS publications, Inc., New York, NY, USA

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Marco Nehmeier.

Additional information

The author has presented the results of this paper during the SCAN 2010 conference in Lyon, September 2010.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Nehmeier, M. Interval arithmetic using expression templates, template meta programming and the upcoming C++ standard. Computing 94, 215–228 (2012). https://doi.org/10.1007/s00607-011-0176-6

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00607-011-0176-6

Keywords

Mathematics Subject Classification (2000)

Navigation