Cosine Special-Function Approximation
Fast, reduced-precision hardware approximation of cos(x).
Vendor-Neutral Definition
d ≈ cos(a), where a is in radians; precision is hardware- and instruction-specific.
⚠️ Cross-vendor mappings describe semantic relationships and are not guaranteed one-to-one compiler
translations.
equivalent with restrictions
Both provide a fast, reduced-precision hardware approximation of cosine.
| Property | NVIDIA PTX | AMDGPU |
|---|---|---|
| Instruction | cos | v_cos_f32 |
| ISA Layer | Virtual | Native |
| Data Types | - | f32 |
| Version / Target Introduced | PTX ISA 1.0 | gfx1100 |
Important Differences
- Approximation error bounds (max ULP) are hardware-generation-specific on both vendors and are not guaranteed to match; do not assume bit-identical results across vendors even when both are described as 'approx'.
Source Evidence
- Parallel Thread Execution ISA ↗ - NVIDIA Corporation
- User Guide for AMDGPU Backend ↗ - LLVM Project
Verification method: documentation