Skip to main content
Log in

Efficient evaluation methods of elementary functions suitable for SIMD computation

  • Special Issue Paper
  • Published:
Computer Science - Research and Development

Abstract

Data-parallel architectures like SIMD (Single Instruction Multiple Data) or SIMT (Single Instruction Multiple Thread) have been adopted in many recent CPU and GPU architectures. Although some SIMD and SIMT instruction sets include double-precision arithmetic and bitwise operations, there are no instructions dedicated to evaluating elementary functions like trigonometric functions in double precision. Thus, these functions have to be evaluated one by one using an FPU or using a software library. However, traditional algorithms for evaluating these elementary functions involve heavy use of conditional branches and/or table look-ups, which are not suitable for SIMD computation. In this paper, efficient methods are proposed for evaluating the sine, cosine, arc tangent, exponential and logarithmic functions in double precision without table look-ups, scattering from, or gathering into SIMD registers, or conditional branches. We implemented these methods using the Intel SSE2 instruction set to evaluate their accuracy and speed. The results showed that the average error was less than 0.67 ulp, and the maximum error was 6 ulps. The computation speed was faster than the FPUs on Intel Core 2 and Core i7 processors.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Seiler L, Carmean D, Sprangle E, Forsyth T, Abrash M, Dubey P, Junkins S, Lake A, Sugerman J, Cavin R, Espasa R, Grochowski E, Juan T, Hanrahan P (2008) Larrabee: a many-core x86 architecture for visual computing. In: Proceedings of ACM SIGGRAPH 2008, pp 1–15

  2. Barker K, Davis K, Hoisie A, Kerbyson D, Lang M, Pakin S, Sancho J (2008) Entering the petaflop era: the architecture and performance of Roadrunner. In: Proceedings of the 2008 ACM/IEEE conference on supercomputing, pp 1–11

  3. Gschwind M, Hofstee H, Flachs B, Hopkins M, Watanabe Y, Yamazaki T (2006) Synergistic processing in cell’s multicore architecture. IEEE MICRO 26(2):10–24

    Article  Google Scholar 

  4. Tesla C2050 and Tesla C2070 Computing Processor Board. http://www.nvidia.com/docs/IO/43395/BD-04983-001_v01.pdf

  5. Thakkar S, Huff T (1999) Internet streaming SIMD extensions. Computer 32(12):26–34

    Article  Google Scholar 

  6. Approximate Math Library 2.0. http://www.intel.com/design/pentiumiii/devtools/AMaths.zip

  7. Simple SSE SSE2 optimized sin, cos, log and exp. http://gruntthepeon.free.fr/ssemath/

  8. Nyland L, Snyder M Fast trigonometric functions using Intel’s SSE2 instructions. Tech Report

  9. Linux Kernel Version 2.6.30.5. http://www.kernel.org/

  10. GNU C Library Version 2.7. http://www.gnu.org/software/libc/

  11. Brent R (2006) Fast algorithms for high-precision computation of elementary functions. In: Proceedings of 7th conference on real numbers and computers (RNC 7), pp 7–8

  12. The MPFR Library. http://www.mpfr.org/

  13. Detrey J, Dinechin F, Pujul X (2007) Return of the hardware floating-point elementary function. In: Proceedings of the 18th IEEE symposium on computer arithmetic, pp 161–168

  14. Koren I, Zinaty O (1990) Evaluating elementary functions in a numerical coprocessor based on rational approximations. IEEE Trans Comput 39(8):1030–1037

    Article  Google Scholar 

  15. Ercegovac M, Lang T, Muller J, Tisserand A (2000) Reciprocation, square root, inverse square root, and some elementary functions using small multipliers. IEEE Trans Comput 49(7):628–637

    Article  MathSciNet  Google Scholar 

  16. Goto E, Wong WF (1995) Fast evaluation of the elementary functions in single precision. IEEE Trans Comput 44(3):453–457

    Article  MATH  Google Scholar 

  17. Scarpazza D, Russell G (2009) High-performance regular expression scanning on the Cell/B.E. processor. In: Proceedings of the 23rd international conference on supercomputing, pp 14–25

  18. Rehman M, Kothapalli K, Narayanan P (2009) Fast and scalable list ranking on the GPU. In: Proceedings of the 23rd international conference on supercomputing, pp 235–243

  19. Goldberg D (1991) What every computer scientist should know about floating-point arithmetic. ACM Comput Surv 23(1):5–48

    Article  Google Scholar 

  20. Abramowitz M, Stegun I (1965) Handbook of mathematical functions: with formulas, graphs, and mathematical tables. Dover, New York

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Naoki Shibata.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Shibata, N. Efficient evaluation methods of elementary functions suitable for SIMD computation. Comput Sci Res Dev 25, 25–32 (2010). https://doi.org/10.1007/s00450-010-0108-2

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00450-010-0108-2

Keywords

Navigation