Revisiting a Basic Function on Current CPUs: A Fast Logarithm Implementation with Adjustable Accuracy
Title | Revisiting a Basic Function on Current CPUs: A Fast Logarithm Implementation with Adjustable Accuracy |
Publication Type | Technical Report |
Year of Publication | 2007 |
Authors | Vinyals, O., Friedland G., & Mirghafori N. |
Other Numbers | 2209 |
Abstract | In this report, we present an implementation of the logarithm function that takes better advantage of the architecture of current processors than previous implementations. The proposed C-language function is a fast single precision approximation of the natural logarithm with adjustable accuracy. Given an IEEE 754 floating point number, the main idea is to use a quantized version of the mantissa as a pointer into a lookup table. The amount of quantization of the mantissa determines the table size and therefore the accuracy. Current processors are able to store relatively large lookup tables in cache memory. Therefore an acceptable accuracy can be reached without too many main memory accesses. We measured a speed up of about factor 6 with respect to the standard C-library implementation while keeping the absolute error as low as 10e?6. This article presents and discusses our proposed implementation with respect to other logarithm realizations on different platforms. Measurements are performed using a dedicated benchmark and by testing the performance of the function as part of a real application. |
URL | http://www.icsi.berkeley.edu/pubs/techreports/TR-07-002.pdf |
Bibliographic Notes | ICSI Technical Report TR-07-002 |
Abbreviated Authors | O. Vinyals, G. Friedland, and N. Mirghafori |
ICSI Research Group | Audio and Multimedia |
ICSI Publication Type | Technical Report |