Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Double precision: Extensions for trigonometry and transcendental functions?

  1. #1
    Junior Member Newbie
    Join Date
    May 2013
    Posts
    5

    Double precision: Extensions for trigonometry and transcendental functions?

    The standard double precision extension only defines addition, multiplication, divison, square-root and a few clamping and comparison functions for double precision datatype. I was wondering if any vendor provides an extension that also provides trigonometry and transcendental functions for double precision?

  2. #2
    Senior Member OpenGL Pro Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    1,136
    Nope!
    You haven't probably seen some previous discussions on the topic. Trigonometric functions (sine and cosine), with some other transcendental are executed fully in hardware (in a single clock), and those functional units are for single precision only. Software emulated version are more expensive, and as far as I know, are not available in GLSL (CUDA has compiler switches to choose implementation). Square-root is probably supported since it is required for normalization DP vectors (I'm personally curious how precise the implemented is.). By the way, even single precision trigonometric functions are useless for small input parameters. That's why I had to implement my own functions that guaranty lsb precision.

  3. #3
    Junior Member Newbie
    Join Date
    May 2013
    Posts
    5
    Thanks for the clarification! I was under the impression that DP functions were also executed in hardware, but I guess I was wrong. I will look at the software emulated versions that people have posted in various forums.

  4. #4
    Senior Member OpenGL Pro Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    1,136
    Modern GPUs have units for double precision, but they execute addition and multiplication (both in a single clock), not transcedental functions. Also, DP-to-SP units ratio is 1:3 or lower. On Fermi the same units are used for both SP and DP, but DP operations requre 2 units.
    It is not hard to implement precise trigonometry. Simly use some polynomial approximation (Taylor for example).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •