
Related items loading ...
Section 1: Publication
Publication Type
Journal Article
Authorship
Green, K. R., Bohn, T. A., & Spiteri, R. J.
Title
Direct Function Evaluation versus Lookup Tables: When to Use Which?
Year
2019
Publication Outlet
SIAM Journal on Scientific Computing, 41(3), C194-C218
DOI
ISBN
ISSN
Citation
Green, K. R., Bohn, T. A., & Spiteri, R. J. (2019). Direct Function Evaluation versus Lookup Tables: When to Use Which?. SIAM Journal on Scientific Computing, 41(3), C194-C218.
https://doi.org/10.1137/18M1201421
Abstract
The speed of mathematical function evaluations can significantly contribute to the overall performance of numerical simulations. Two common approaches to evaluate a mathematical function are by direct evaluation or by means of lookup tables of precomputed values. Direct evaluation is the standard approach, and lookup tables are common in graphics applications and field-programmable gate array computing. We address the usage of direct function evaluation versus lookup tables for evaluating general univariate functions on general-purpose CPUs for large-scale numerical simulation. We introduce a small C++ library called FunC (for Function Comparator) that can be run on a given system to quickly and conveniently evaluate the performance of direct evaluation relative to various lookup table implementations for arbitrary user-specified functions. A user can then make an informed decision as to which method can be expected to be most efficient for their application. Using functions relevant to the Chaste software library for the simulation of cardiac models, FunC successfully predicts that lookup table implementations outperform direct evaluation. After implementing higher-order lookup tables in Chaste to test these predictions, we demonstrate the effects of table size on two simulations, one small and one large. For the small simulation, we see an increase in the simulation speed of up to 25% for tables using cubic interpolation over those using linear interpolation and up to 144% for cubic tables over direct evaluation. For the more realistic large simulation, we see an increase in the simulation speed by up to 86% for lookup tables over direct evaluation.
Plain Language Summary