T-SIMD v31.1.0
A C++ template SIMD library
Loading...
Searching...
No Matches
Mathematical Functions

Description

Mathematical functions on Vec's, such as sqrt, rcp, etc.

See also
Masked Mathematical Functions

Functions

template<typename T , size_t SIMD_WIDTH>
static Vec< T, SIMD_WIDTH > simd::rcp (const Vec< T, SIMD_WIDTH > &a)
 Computes the approximate reciprocal of the elements of a Vec.
 
template<typename T , size_t SIMD_WIDTH>
static Vec< T, SIMD_WIDTH > simd::rsqrt (const Vec< T, SIMD_WIDTH > &a)
 Computes the approximate reciprocal square root of the elements of a Vec.
 
template<typename T , size_t SIMD_WIDTH>
static Vec< T, SIMD_WIDTH > simd::sqrt (const Vec< T, SIMD_WIDTH > &a)
 Computes the square root of the elements of a Vec.
 

Function Documentation

◆ rcp()

template<typename T , size_t SIMD_WIDTH>
static Vec< T, SIMD_WIDTH > simd::rcp ( const Vec< T, SIMD_WIDTH > & a)
inlinestatic

Computes the approximate reciprocal of the elements of a Vec.

This function is only available for floating point types.

Parameters
aVec to compute the reciprocal of
Returns
Vec containing the approximate reciprocal of the elements of the input Vec

◆ rsqrt()

template<typename T , size_t SIMD_WIDTH>
static Vec< T, SIMD_WIDTH > simd::rsqrt ( const Vec< T, SIMD_WIDTH > & a)
inlinestatic

Computes the approximate reciprocal square root of the elements of a Vec.

This function is only available for floating point types.

Parameters
aVec to compute the reciprocal square root of
Returns
Vec containing the approximate reciprocal square root of the elements of the input Vec

◆ sqrt()

template<typename T , size_t SIMD_WIDTH>
static Vec< T, SIMD_WIDTH > simd::sqrt ( const Vec< T, SIMD_WIDTH > & a)
inlinestatic

Computes the square root of the elements of a Vec.

This function is only available for floating point types.

Note
This function may only compute an approximation on some architectures.
Parameters
aVec to compute the square root of
Returns
Vec containing the square root of the elements of the input Vec