# CUDA Math API Reference Manual

CUDA mathematical functions are always available in device code.

Host implementations of the common mathematical functions are mapped in a platform-specific way to standard math library functions, provided by the host compiler and respective host libm where available. Some functions, not available with the host compilers, are implemented in crt/math_functions.hpp header file. For example, see erfinv(). Other, less common functions, like rhypot(), cyl_bessel_i0() are only available in device code.

CUDA Math device functions are no-throw for well-formed CUDA programs.

Note that many floating-point and integer functions names are overloaded for different argument types. For example, the log() function has the following prototypes:

```
double log(double x);
float log(float x);
float logf(float x);
```

Note also that due to implementation constraints, certain math functions from std:: namespace may be callable in device code even via explicitly qualified std:: names. However, such use is discouraged, since this capability is unsupported, unverified, undocumented, not portable, and may change without notice.

- 1. FP8 Intrinsics
- 2. Half Precision Intrinsics
- 3. Bfloat16 Precision Intrinsics
- 4. Single Precision Mathematical Functions
- 5. Single Precision Intrinsics
- 6. Double Precision Mathematical Functions
- 7. Double Precision Intrinsics
- 8. Type Casting Intrinsics
- 9. Integer Mathematical Functions
- 10. Integer Intrinsics
- 11. SIMD Intrinsics
- 12. Structs
- 13. Notices