Abstract
Computing elementary functions on large arrays is an essential part of many machine learning and signal processing algorithms. Since the introduction of floating-point computations in mainstream processors, table lookups, division, square root, and piecewise approximations were essential components of elementary functions implementations. However, we suggest that these operations can not deliver high throughput on modern processors, and argue that algorithms which rely only on multiplication, addition, and integer operations would achieve higher performance. We propose 4 design principles for high-throughput elementary functions and suggest how to apply them to implementation of log, exp, sin, and tan functions. We evaluate the performance and accuracy of the new algorithms on three recent x86 microarchitectures and demonstrate that they compare favorably to previously published research and vendor-optimized libraries.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Repository is hosted on bitbucket.org/MDukhan/hysteria.
References
Bailey, R.: Polar generation of random variates with the t-distribution. Math. Comput. 62(206), 779–782 (1994)
Box, G., Muller, M.: A note on the generation of random normal deviates. Ann. Math. Stat. 29(2), 610–611 (1958)
Brisebarre, N., Chevillard, S.: Efficient polynomial \(L^{\infty }\)-approximations. In: 18th IEEE Symposium on Computer Arithmetic, 2007. ARITH’07. pp. 169–176. IEEE (2007)
Cody, W., Waite, W.: Software Manual for the Elementary Functions. Prentice-Hall, New Jersey (1980)
de Dinechin, F., Defour, D., Lauter, C., et al.: Fast correct rounding of elementary functions in double precision using double-extended arithmetic (2004)
Fog, A.: Instruction tables: lists of instruction latencies, throughputs and micro-operation breakdowns for Intel. AMD and VIA CPUs, Technical report (2012)
Fousse, L., Hanrot, G., Lefèvre, V., Pélissier, P., Zimmermann, P.: MPFR: a multipleprecision binary floating-point library with correct rounding. ACM Trans. Math. Softw. (TOMS) 33(2), 13 (2007)
Gal, S.: An accurate elementary mathematical library for the ieee floating point standard. ACM Trans. Math. Softw. (TOMS) 17(1), 26–45 (1991)
Gentle, J.E.: Random Number Generation and Monte Carlo Methods. Springer, New York (2003)
Markstein, P.: IA-64 and Elementary Functions: Speed and Precision. Prentice Hall, New Jersey (2000)
Muller, J.-M.: Elementary Functions: Algorithms and Implementation. Birkhauser, Boston (1997)
Muller, J.-M., Brisebarre, N., de Dinechin, F., Jeannerod, C.-P., Lefevre, V., Melquiond, G., Revol, N., Stehle, D., Torres, S., Muller, J.-M., Brisebarre, N., Dinechin, F., Jeannerod, C.-P., Lefevre, V., Melquiond, G., Revol, N., Stehle, D., Torres, S.: Handbook of Floating-Point Arithmetic. Birkhauser, Boston (2010)
Ng, K.C.: Argument reduction for huge arguments: Good to the last bit (1992)
Payne, M., Hanek, R.: Radian reduction for trigonometric functions. ACM SIGNUM Newsl. 18(1), 19–24 (1983)
Press, W., Teukolsky, S., Vetterling, W., Flannery, B.: Numerical Recipes: The Art of Scientific Computing. Cambridge University Press, Cambridge (2007)
Shibata, N.: Efficient evaluation methods of elementary functions suitable for SIMD computation. Comput. Sci.-Res. Dev. 25(1), 25–32 (2010)
Tang, P.: Table-lookup algorithms for elementary functions and their error analysis. In: Proceedings of the 10th IEEE Symposium on Computer Arithmetic, 1991. pp. 232–236. IEEE (1991)
Williams, C.K.I., Rasmussen, C.E.: Gaussian Processes for Machine Learning, MIT Press, Cambridge (2006)
Wong, W.-F., Goto, E.: Fast evaluation of the elementary functions in single precision. IEEE Trans. Comput. 44(3), 453–457 (1995)
Acknowledgements
This work was supported in part by the National Science Foundation (NSF) under NSF CAREER award number 0953100 and the U.S. Dept. of Energy (DOE), Office of Science, Advanced Scientific Computing Research under award DE-FC02-10ER26006/DE-SC0004915. Any opinions, findings and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect those of NSF or DOE.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2014 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Dukhan, M., Vuduc, R. (2014). Methods for High-Throughput Computation of Elementary Functions. In: Wyrzykowski, R., Dongarra, J., Karczewski, K., Waśniewski, J. (eds) Parallel Processing and Applied Mathematics. PPAM 2013. Lecture Notes in Computer Science(), vol 8384. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-55224-3_9
Download citation
DOI: https://doi.org/10.1007/978-3-642-55224-3_9
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-55223-6
Online ISBN: 978-3-642-55224-3
eBook Packages: Computer ScienceComputer Science (R0)