|
| template<std::floating_point T> |
| constexpr T | pi () |
| |
| __host__ __device__ double | cospi (double x) |
| | Return cos(x*pi) given x.
|
| |
| __host__ __device__ float | cospi (float x) |
| | Return cos(x*pi) given x.
|
| |
| __host__ __device__ double | sinpi (double x) |
| | Return sin(x*pi) given x.
|
| |
| __host__ __device__ float | sinpi (float x) |
| | Return sin(x*pi) given x.
|
| |
| __host__ __device__ std::pair< double, double > | sincos (double x) |
| | Return sine and cosine of given number.
|
| |
| __host__ __device__ std::pair< float, float > | sincos (float x) |
| | Return sine and cosine of given number.
|
| |
| __host__ __device__ std::pair< double, double > | sincospi (double x) |
| | Return sin(pi*x) and cos(pi*x) given x.
|
| |
| __host__ __device__ std::pair< float, float > | sincospi (float x) |
| | Return sin(pi*x) and cos(pi*x) given x.
|
| |
template<int Power, typename T >
requires (!std::integral<T> || Power >= 0) |
| constexpr T | powi (T x) noexcept |
| | Return pow(x, Power), where Power is an integer known at compile time.
|
| |
| __host__ __device__ float | powi (float x, int n) noexcept |
| |
| __host__ __device__ double | powi (double x, int n) noexcept |
| |
| template<typename T > |
| __host__ __device__ T | comp_ellint_1 (T k) |
| |
| template<typename T > |
| __host__ __device__ T | comp_ellint_2 (T k) |
| |
| __host__ __device__ double | rsqrt (double x) |
| | Return inverse square root of x.
|
| |
| __host__ __device__ float | rsqrt (float x) |
| | Return inverse square root of x.
|
| |
| __host__ __device__ double | exp10 (double x) |
| | Return 10**x.
|
| |
| __host__ __device__ float | exp10 (float x) |
| | Return 10**x.
|
| |
| __host__ __device__ float amrex::Math::powi |
( |
float |
x, |
|
|
int |
n |
|
) |
| |
|
inlinenoexcept |
Return pow(x, n) with a runtime integer exponent.
On GPU backends this routes to the integer-exponent intrinsic (libdevice __nv_powif / __nv_powi on CUDA, __ocml_pown_f32 / __ocml_pown_f64 on HIP, sycl::pown on SYCL), which is faster than the general pow and avoids the C++11 mixed-arg promotion that would otherwise call the slower double-precision pow(double, double) and narrow on return. On host it casts the int exponent to the floating-point type and calls std::pow.