# double precision trigonometric functions

**URL:** <https://forums.developer.nvidia.com/t/double-precision-trigonometric-functions/34217>\
**Category:** OptiX\
**Created:** [July 28, 2014, 7:49am UTC](https://forums.developer.nvidia.com/t/double-precision-trigonometric-functions/34217 "2014-07-28T07:49:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![superbetonio](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@superbetonio](https://forums.developer.nvidia.com/u/superbetonio)\
**Post date:** [July 28, 2014, 7:49am UTC](https://forums.developer.nvidia.com/t/double-precision-trigonometric-functions/34217/1 "2014-07-28T07:49:03Z")

</div>

Hi all,

I’m having a code that is doing a lot of computations in double precision. It worked fine with OptiX 2.5. But as I’m trying to migrate the project to OptiX 3.5 and CUDA toolkit 5.5, I’m getting the following runtime error:

Details: Function “\_rtProgramCreateFromPTXFile” caught exception: defs/uses not defined for PTX instruction (Try --use\_fast\_math): madc.hi, [1310866])

I traced the error down to calls of the cos- and sin-functions for double variables. If I compile the project for compute capability 1.3 (-arch sm\_13) and use fast math (–use\_fast\_math) everything works fine. I think I read somewhere, that compiling for this compute capability automatically treats all doubles as floats.

Am I right that usage of cos-calls for double precision are not allowed in OptiX 3.5 anymore?  
Is there anything I can do about it?

---

<div class="post-metadata">

**Author:** ![superbetonio](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@superbetonio](https://forums.developer.nvidia.com/u/superbetonio)\
**Post date:** [August 11, 2014, 11:10am UTC](https://forums.developer.nvidia.com/t/double-precision-trigonometric-functions/34217/2 "2014-08-11T11:10:35Z")

</div>

Hi all,

with the help of the OptiX team I was able to locate the problem. It seems that CUDA toolkits starting from 4.2 produce ptx code, that is incompatible with OptiX, for a call to double precision trigonometric functions. So my solution is to use OptiX 3.5 with CUDA 4.0. This seems to work for me.

---

<div class="post-metadata">

**Author:** ![TomNVIDIA](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/tomnvidia/32/14181_2.png) [@TomNVIDIA](https://forums.developer.nvidia.com/u/TomNVIDIA)\
**Post date:** [June 14, 2022, 9:11pm UTC](https://forums.developer.nvidia.com/t/double-precision-trigonometric-functions/34217/3 "2022-06-14T21:11:48Z")

</div>


