@Article{Nelson:2014:AOA, author = "Blake Nelson and Robert M Kirby and Steven Parker", title = "Algorithm 940: Optimal Accumulator-Based Expression Evaluation Through the Use of Expression Templates", journal = "{ACM} Transactions on Mathematical Software", volume = 40, number = 3, year = 2014, month = apr, pages = "21:1--21:21", url = "http://doi.acm.org/10.1145/2591005", accepted = "24 August 2013", abstract = " In this article we present a compile-time algorithm, implemented using C++ template metaprogramming techniques, that minimizes the use of temporary storage when evaluating expressions. We present the basic building blocks of our algorithm---transformations that act locally on nodes of the expression parse tree---and demonstrate that the application of these local transformations generate a (non-unique) expression that requires a minimum number of temporary storage objects to evaluate. We discuss a C++ implementation of our algorithm using expression templates, and give results demonstrating the effectiveness of our approach.", }