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.
Similar content being viewed by others
References
Alexandrescu A (2001) Modern C++ design: generic programming and design patterns applied. Addison-Wesley Longman Publishing Co. Inc., Boston
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
Becker P (2011) Working Draft, Standard for Programming Language C++. Tech. Rep. N3242=11-0012, ISO/IEC JTC1/SC22/WG21
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
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
Bischof CH, Roh L, Mauer A (1997) ADIC—An extensible automatic differentiation tool for ANSI-C. Softw Pract Exp 27(12): 1427–1456
Boost Interval Arithmetic Library (2011). http://www.boost.org/doc/libs/1_46_1/libs/numeric/interval/doc/interval.htm
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
CRlibm-Correctly Rounded mathematical library (2011). http://lipforge.ens-lyon.fr/www/crlibm/
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
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
Gregor D, Järvi J, Powell G (2006) Variadic templates (revision 3). Tech. Rep. N2080=06-0150, ISO/IEC JTC1/SC22/WG21
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
Hammer R, Ratz D, Kulisch U, Hocks M (1997) C++ Toolbox for Verified Computing I: Basic Numerical Problems. Springer-Verlag New York Inc., Secaucus
Hascoët L, Pascual V (2004) TAPENADE 2.1 user’s guide. Rapport technique 300, INRIA, Sophia Antipolis
Järvi J, Stroustrup B, Reis GD (2004) Decltype and auto (revision 4). Tech. Rep. N1705=04-0145, ISO/IEC JTC1/SC22/WG21
Lambov B (2008) Interval arithmetic using SSE-2. Lecture Notes in Computer Science, vol 5045, pp 102–113
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
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
Nehmeier M, Wolff von Gudenberg J (2011) filib++, Expression Templates and the Coming Interval Standard. Reliab Comput 15(4): 312–320
Rall LB (1981) Automatic differentiation: techniques and applications. Lecture Notes in Computer Science, vol 120. Springer, Berlin
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
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
Author information
Authors and Affiliations
Corresponding author
Additional information
The author has presented the results of this paper during the SCAN 2010 conference in Lyon, September 2010.
Rights 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
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00607-011-0176-6
Keywords
- Interval arithmetic
- Automatic differentiation
- Expression templates
- Template meta programming
- Compile time code optimization
- C++
- C++0x