NVIDIA DeepStream SDK API Reference

9.2 Release
half_float::detail Namespace Reference

Data Structures

struct  binary_t
 Tag type for binary construction. More...
 
struct  bits
 Type traits for floating-point bits. More...
 
struct  bits< const T >
 
struct  bits< const volatile T >
 
struct  bits< double >
 Unsigned integer of (at least) 64 bits width. More...
 
struct  bits< float >
 Unsigned integer of (at least) 32 bits width. More...
 
struct  bits< volatile T >
 
struct  bool_type
 Helper for tag dispatching. More...
 
struct  conditional
 Conditional type. More...
 
struct  conditional< false, T, F >
 
struct  f31
 Class for 1.31 unsigned floating-point computation. More...
 
struct  half_caster
 Helper class for half casts. More...
 
struct  half_caster< half, half, R >
 
struct  half_caster< half, U, R >
 
struct  half_caster< T, half, R >
 
struct  is_float
 Type traits for floating-point types. More...
 
struct  is_float< const T >
 
struct  is_float< const volatile T >
 
struct  is_float< double >
 
struct  is_float< float >
 
struct  is_float< long double >
 
struct  is_float< volatile T >
 

Typedefs

typedef bool_type< true > true_type
 
typedef bool_type< false > false_type
 
typedef unsigned short uint16
 Unsigned integer of (at least) 16 bits width. More...
 
typedef unsigned long uint32
 Fastest unsigned integer of (at least) 32 bits width. More...
 
typedef long int32
 Fastest unsigned integer of (at least) 32 bits width. More...
 

Variables

HALF_CONSTEXPR_CONST binary_t binary = binary_t()
 Tag for binary construction. More...
 

Typedef Documentation

◆ false_type

Definition at line 489 of file includes/half.hpp.

◆ int32

Fastest unsigned integer of (at least) 32 bits width.

Definition at line 530 of file includes/half.hpp.

◆ true_type

Definition at line 488 of file includes/half.hpp.

◆ uint16

typedef unsigned short half_float::detail::uint16

Unsigned integer of (at least) 16 bits width.

Definition at line 524 of file includes/half.hpp.

◆ uint32

typedef unsigned long half_float::detail::uint32

Fastest unsigned integer of (at least) 32 bits width.

Definition at line 527 of file includes/half.hpp.

Function Documentation

◆ angle_arg()

uint32 half_float::detail::angle_arg ( unsigned int  abs,
int &  k 
)
inline

Reduce argument for trigonometric functions.

Parameters
abshalf-precision floating-point value
kvalue to take quarter period
Returns
abs reduced to [-pi/4,pi/4] as Q0.30

Definition at line 1621 of file includes/half.hpp.

References half_float::abs(), half_float::exp(), and multiply64().

Referenced by half_float::cos(), half_float::sin(), half_float::sincos(), and half_float::tan().

◆ area()

template<std::float_round_style R, bool S>
unsigned int half_float::detail::area ( unsigned int  arg)

Area function and postprocessing.

This computes the value directly in Q2.30 using the representation asinh|acosh(x) = log(x+sqrt(x^2+|-1)).

Template Parameters
Rrounding mode to use
Strue for asinh, false for acosh
Parameters
arghalf-precision argument
Returns
asinh|acosh(arg) converted to half-precision
Exceptions
FE_OVERFLOWon overflows
FE_UNDERFLOWon underflows
FE_INEXACTif no other exception occurred

Definition at line 1805 of file includes/half.hpp.

References half_float::abs(), and log2().

◆ arithmetic_shift()

uint32 half_float::detail::arithmetic_shift ( uint32  arg,
int  i 
)
inline

Platform-independent arithmetic right shift.

Parameters
arginteger value in two's complement
ishift amount (at most 31)
Returns
arg right shifted for i bits with possible sign extension

Definition at line 622 of file includes/half.hpp.

Referenced by atan2(), and sincos().

◆ atan2()

uint32 half_float::detail::atan2 ( uint32  my,
uint32  mx,
unsigned int  n = 31 
)
inline

Fixed point arc tangent.

This uses the CORDIC algorithm in vectoring mode.

Parameters
myy coordinate as Q0.30
mxx coordinate as Q0.30
nnumber of iterations (at most 31)
Returns
arc tangent of my / mx as Q1.30

Definition at line 1599 of file includes/half.hpp.

References arithmetic_shift(), and sign_mask().

Referenced by half_float::acos(), half_float::asin(), half_float::atan(), and half_float::atan2().

◆ atan2_args()

std::pair< uint32, uint32 > half_float::detail::atan2_args ( unsigned int  abs)
inline

Get arguments for atan2 function.

Parameters
abshalf-precision floating-point value
Returns
abs and sqrt(1 - abs^2) as Q0.30

Definition at line 1644 of file includes/half.hpp.

References half_float::abs(), and half_float::exp().

Referenced by half_float::acos(), and half_float::asin().

◆ builtin_isinf()

template<typename T >
bool half_float::detail::builtin_isinf ( T  arg)

Check for infinity.

Template Parameters
Targument type (builtin floating-point type)
Parameters
argvalue to query
Return values
trueif infinity
falseelse

Definition at line 563 of file includes/half.hpp.

References half_float::isinf().

Referenced by float2half_impl().

◆ builtin_isnan()

template<typename T >
bool half_float::detail::builtin_isnan ( T  arg)

Check for NaN.

Template Parameters
Targument type (builtin floating-point type)
Parameters
argvalue to query
Return values
trueif not a number
falseelse

Definition at line 579 of file includes/half.hpp.

References half_float::isnan().

Referenced by float2half_impl(), and half_float::nexttoward().

◆ builtin_signbit()

template<typename T >
bool half_float::detail::builtin_signbit ( T  arg)

Check sign.

Template Parameters
Targument type (builtin floating-point type)
Parameters
argvalue to query
Return values
trueif signbit set
falseelse

Definition at line 595 of file includes/half.hpp.

References half_float::signbit().

Referenced by float2half_impl(), and half_float::nexttoward().

◆ check_underflow()

HALF_CONSTEXPR_NOERR unsigned int half_float::detail::check_underflow ( unsigned int  arg)
inline

Check value for underflow.

Parameters
argnon-zero half-precision value to check
Returns
arg
Exceptions
FE_UNDERFLOWif arg is subnormal

Definition at line 784 of file includes/half.hpp.

References FE_UNDERFLOW.

Referenced by exp2_post(), half_float::hypot(), and half_float::pow().

◆ compsignal()

HALF_CONSTEXPR_NOERR bool half_float::detail::compsignal ( unsigned int  x,
unsigned int  y 
)
inline

Check and signal for any NaN.

Parameters
xfirst half-precision value to check
ysecond half-precision value to check
Return values
trueif either x or y is NaN
falseelse
Exceptions
FE_INVALIDif x or y is NaN

Definition at line 696 of file includes/half.hpp.

References FE_INVALID.

Referenced by half_float::operator!=(), half_float::operator<(), half_float::operator<=(), half_float::operator==(), half_float::operator>(), and half_float::operator>=().

◆ divide64()

uint32 half_float::detail::divide64 ( uint32  x,
uint32  y,
int &  s 
)
inline

64-bit division.

Parameters
xupper 32 bit of dividend
ydivisor
svariable to store sticky bit for rounding
Returns
(x << 32) / y

Definition at line 1397 of file includes/half.hpp.

Referenced by half_float::atanh(), half_float::cbrt(), exp2_post(), half_float::expm1(), hyperbolic_args(), log2_post(), and tangent_post().

◆ erf()

template<std::float_round_style R, bool C>
unsigned int half_float::detail::erf ( unsigned int  arg)

Error function and postprocessing.

This computes the value directly in Q1.31 using the approximations given here.

Template Parameters
Rrounding mode to use
Ctrue for comlementary error function, false else
Parameters
arghalf-precision function argument
Returns
approximated value of error function in half-precision
Exceptions
FE_OVERFLOWon overflows
FE_UNDERFLOWon underflows
FE_INEXACTif no other exception occurred

Definition at line 1935 of file includes/half.hpp.

References half_float::abs(), half_float::detail::f31::exp, exp2(), and half_float::detail::f31::m.

◆ errflags()

int & half_float::detail::errflags ( )
inline

Internal exception flags.

Returns
reference to global exception flags

Definition at line 637 of file includes/half.hpp.

References HALF_THREAD_LOCAL.

Referenced by half_float::feclearexcept(), half_float::fegetexceptflag(), half_float::feraiseexcept(), half_float::fesetexceptflag(), half_float::fetestexcept(), half_float::fethrowexcept(), and raise().

◆ exp2()

uint32 half_float::detail::exp2 ( uint32  m,
unsigned int  n = 32 
)
inline

Fixed point binary exponential.

This uses the BKM algorithm in E-mode.

Parameters
mexponent in [0,1) as Q0.31
nnumber of iterations (at most 32)
Returns
2 ^ m as Q1.31

Definition at line 1521 of file includes/half.hpp.

Referenced by half_float::cbrt(), erf(), exp2_post(), half_float::expm1(), gamma(), and hyperbolic_args().

◆ exp2_post()

template<std::float_round_style R>
unsigned int half_float::detail::exp2_post ( uint32  m,
int  exp,
bool  esign,
unsigned int  sign = 0,
unsigned int  n = 32 
)

Postprocessing for binary exponential.

Template Parameters
Rrounding mode to use
Parameters
mfractional part of as Q0.31
expabsolute value of unbiased exponent
esignsign of actual exponent
signsign bit of result
nnumber of BKM iterations (at most 32)
Returns
value converted to half-precision
Exceptions
FE_OVERFLOWon overflows
FE_UNDERFLOWon underflows
FE_INEXACTif value had to be rounded or I is true

Definition at line 1705 of file includes/half.hpp.

References check_underflow(), divide64(), half_float::exp(), and exp2().

◆ fixed2half()

template<std::float_round_style R, unsigned int F, bool S, bool N, bool I>
unsigned int half_float::detail::fixed2half ( uint32  m,
int  exp = 14,
unsigned int  sign = 0,
int  s = 0 
)

Convert fixed point to half-precision floating-point.

Template Parameters
Rrounding mode to use
Fnumber of fractional bits in [11,31]
Strue for signed, false for unsigned
Ntrue for additional normalization step, false if already normalized to 1.F
Itrue to always raise INEXACT exception, false to raise only for rounded results
Parameters
mmantissa in Q1.F fixed point format
expbiased exponent - 1
signhalf-precision value with sign bit only
ssticky bit (or of all but the most significant already discarded bits)
Returns
value converted to half-precision
Exceptions
FE_OVERFLOWon overflows
FE_UNDERFLOWon underflows
FE_INEXACTif value had to be rounded or I is true

Definition at line 901 of file includes/half.hpp.

References half_float::exp(), and sign_mask().

◆ float2half()

template<std::float_round_style R, typename T >
unsigned int half_float::detail::float2half ( T  value)

Convert floating-point to half-precision.

Template Parameters
Rrounding mode to use
Tsource type (builtin floating-point type)
Parameters
valuefloating-point value to convert
Returns
rounded half-precision value
Exceptions
FE_OVERFLOWon overflows
FE_UNDERFLOWon underflows
FE_INEXACTif value had to be rounded

Definition at line 1081 of file includes/half.hpp.

◆ float2half_impl() [1/3]

template<std::float_round_style R>
unsigned int half_float::detail::float2half_impl ( double  value,
true_type   
)

Convert IEEE double-precision to half-precision.

Template Parameters
Rrounding mode to use
Parameters
valuedouble-precision value to convert
Returns
rounded half-precision value
Exceptions
FE_OVERFLOWon overflows
FE_UNDERFLOWon underflows
FE_INEXACTif value had to be rounded

Definition at line 1012 of file includes/half.hpp.

◆ float2half_impl() [2/3]

template<std::float_round_style R>
unsigned int half_float::detail::float2half_impl ( float  value,
true_type   
)

Convert IEEE single-precision to half-precision.

Credit for this goes to Jeroen van der Zijp.

Template Parameters
Rrounding mode to use
Parameters
valuesingle-precision value to convert
Returns
rounded half-precision value
Exceptions
FE_OVERFLOWon overflows
FE_UNDERFLOWon underflows
FE_INEXACTif value had to be rounded

Definition at line 924 of file includes/half.hpp.

References half_float::exp().

◆ float2half_impl() [3/3]

template<std::float_round_style R, typename T >
unsigned int half_float::detail::float2half_impl ( T  value,
  ... 
)

Convert non-IEEE floating-point to half-precision.

Template Parameters
Rrounding mode to use
Tsource type (builtin floating-point type)
Parameters
valuefloating-point value to convert
Returns
rounded half-precision value
Exceptions
FE_OVERFLOWon overflows
FE_UNDERFLOWon underflows
FE_INEXACTif value had to be rounded

Definition at line 1048 of file includes/half.hpp.

References half_float::abs(), builtin_isinf(), builtin_isnan(), builtin_signbit(), half_float::exp(), half_float::frexp(), half_float::ldexp(), and half_float::modf().

◆ gamma()

template<std::float_round_style R, bool L>
unsigned int half_float::detail::gamma ( unsigned int  arg)

Gamma function and postprocessing.

This approximates the value of either the gamma function or its logarithm directly in Q1.31.

Template Parameters
Rrounding mode to use
Ltrue for lograithm of gamma function, false for gamma function
Parameters
arghalf-precision floating-point value
Returns
lgamma/tgamma(arg) in half-precision
Exceptions
FE_OVERFLOWon overflows
FE_UNDERFLOWon underflows
FE_INEXACTif arg is not a positive integer

Definition at line 1954 of file includes/half.hpp.

References half_float::abs(), half_float::detail::f31::exp, exp2(), log2(), half_float::detail::f31::m, and sincos().

◆ half2float()

template<typename T >
T half_float::detail::half2float ( unsigned int  value)

Convert half-precision to floating-point.

Template Parameters
Ttype to convert to (builtin integer type)
Parameters
valuehalf-precision value to convert
Returns
floating-point value

Definition at line 1320 of file includes/half.hpp.

References half2float_impl().

◆ half2float_impl() [1/3]

double half_float::detail::half2float_impl ( unsigned int  value,
double  ,
true_type   
)
inline

Convert half-precision to IEEE double-precision.

Parameters
valuehalf-precision value to convert
Returns
double-precision value

Definition at line 1276 of file includes/half.hpp.

References half_float::abs().

◆ half2float_impl() [2/3]

float half_float::detail::half2float_impl ( unsigned int  value,
float  ,
true_type   
)
inline

Convert half-precision to IEEE single-precision.

Credit for this goes to Jeroen van der Zijp.

Parameters
valuehalf-precision value to convert
Returns
single-precision value

Definition at line 1113 of file includes/half.hpp.

References half_float::abs().

Referenced by half2float().

◆ half2float_impl() [3/3]

template<typename T >
T half_float::detail::half2float_impl ( unsigned int  value,
T  ,
  ... 
)

Convert half-precision to non-IEEE floating-point.

Template Parameters
Ttype to convert to (builtin integer type)
Parameters
valuehalf-precision value to convert
Returns
floating-point value

Definition at line 1300 of file includes/half.hpp.

References half_float::abs(), half_float::ldexp(), and max().

◆ half2int()

template<std::float_round_style R, bool E, bool I, typename T >
T half_float::detail::half2int ( unsigned int  value)

Convert half-precision floating-point to integer.

Template Parameters
Rrounding mode to use
Etrue for round to even, false for round away from zero
Itrue to raise INEXACT exception (if inexact), false to never raise it
Ttype to convert to (buitlin integer type with at least 16 bits precision, excluding any implicit sign bits)
Parameters
valuehalf-precision value to convert
Returns
rounded integer value
Exceptions
FE_INVALIDif value is not representable in type T
FE_INEXACTif value had to be rounded and I is true

Definition at line 1334 of file includes/half.hpp.

References half_float::abs(), half_float::exp(), FE_INEXACT, FE_INVALID, max(), and min().

◆ hyperbolic_args()

std::pair< uint32, uint32 > half_float::detail::hyperbolic_args ( unsigned int  abs,
int &  exp,
unsigned int  n = 32 
)
inline

Get exponentials for hyperbolic computation.

Parameters
abshalf-precision floating-point value
expvariable to take unbiased exponent of larger result
nnumber of BKM iterations (at most 32)
Returns
exp(abs) and exp(-abs) as Q1.31 with same exponent

Definition at line 1667 of file includes/half.hpp.

References half_float::abs(), divide64(), half_float::exp(), exp2(), and multiply64().

Referenced by half_float::cosh(), half_float::sinh(), and half_float::tanh().

◆ hypot_post()

template<std::float_round_style R>
unsigned int half_float::detail::hypot_post ( uint32  r,
int  exp 
)

Hypotenuse square root and postprocessing.

Template Parameters
Rrounding mode to use
Parameters
rmantissa as Q2.30
expbiased exponent
Returns
square root converted to half-precision
Exceptions
FE_OVERFLOWon overflows
FE_UNDERFLOWon underflows
FE_INEXACTif value had to be rounded

Definition at line 1762 of file includes/half.hpp.

References half_float::exp().

◆ int2half()

template<std::float_round_style R, typename T >
unsigned int half_float::detail::int2half ( T  value)

Convert integer to half-precision floating-point.

Template Parameters
Rrounding mode to use
Ttype to convert (builtin integer type)
Parameters
valueintegral value to convert
Returns
rounded half-precision value
Exceptions
FE_OVERFLOWon overflows
FE_INEXACTif value had to be rounded

Definition at line 1093 of file includes/half.hpp.

References half_float::exp().

◆ integral()

template<std::float_round_style R, bool E, bool I>
unsigned int half_float::detail::integral ( unsigned int  value)

Round half-precision number to nearest integer value.

Template Parameters
Rrounding mode to use
Etrue for round to even, false for round away from zero
Itrue to raise INEXACT exception (if inexact), false to never raise it
Parameters
valuehalf-precision value to round
Returns
half-precision bits for nearest integral value
Exceptions
FE_INVALIDfor signaling NaN
FE_INEXACTif value had to be rounded and I is true

Definition at line 866 of file includes/half.hpp.

References half_float::abs(), half_float::exp(), FE_INEXACT, and signal().

◆ invalid()

◆ log2()

uint32 half_float::detail::log2 ( uint32  m,
unsigned int  n = 32 
)
inline

Fixed point binary logarithm.

This uses the BKM algorithm in L-mode.

Parameters
mmantissa in [1,2) as Q1.30
nnumber of iterations (at most 32)
Returns
log2(m) as Q0.31

Definition at line 1548 of file includes/half.hpp.

Referenced by area(), half_float::atanh(), gamma(), half_float::log(), half_float::log10(), and half_float::log1p().

◆ log2_post()

template<std::float_round_style R, uint32 L>
unsigned int half_float::detail::log2_post ( uint32  m,
int  ilog,
int  exp,
unsigned int  sign = 0 
)

Postprocessing for binary logarithm.

Template Parameters
Rrounding mode to use
Llogarithm for base transformation as Q1.31
Parameters
mfractional part of logarithm as Q0.31
ilogsigned integer part of logarithm
expbiased exponent of result
signsign bit of result
Returns
value base-transformed and converted to half-precision
Exceptions
FE_OVERFLOWon overflows
FE_UNDERFLOWon underflows
FE_INEXACTif no other exception occurred

Definition at line 1737 of file includes/half.hpp.

References divide64(), half_float::exp(), and sign_mask().

◆ mod()

template<bool Q, bool R>
unsigned int half_float::detail::mod ( unsigned int  x,
unsigned int  y,
int *  quo = NULL 
)

Half precision positive modulus.

Template Parameters
Qtrue to compute full quotient, false else
Rtrue to compute signed remainder, false for positive remainder
Parameters
xfirst operand as positive finite half-precision value
ysecond operand as positive finite half-precision value
quoadress to store quotient at, nullptr if Q false
Returns
modulus of x / y

Definition at line 1426 of file includes/half.hpp.

References half_float::exp().

◆ mulhi()

template<std::float_round_style R>
uint32 half_float::detail::mulhi ( uint32  x,
uint32  y 
)

upper part of 64-bit multiplication.

Template Parameters
Rrounding mode to use
Parameters
xfirst factor
ysecond factor
Returns
upper 32 bit of x * y

Definition at line 1372 of file includes/half.hpp.

◆ multiply64()

uint32 half_float::detail::multiply64 ( uint32  x,
uint32  y 
)
inline

64-bit multiplication.

Parameters
xfirst factor
ysecond factor
Returns
upper 32 bit of x * y rounded to nearest

Definition at line 1383 of file includes/half.hpp.

Referenced by angle_arg(), half_float::cbrt(), half_float::exp(), half_float::expm1(), hyperbolic_args(), and half_float::pow().

◆ overflow()

template<std::float_round_style R>
HALF_CONSTEXPR_NOERR unsigned int half_float::detail::overflow ( unsigned int  sign = 0)

Half-precision overflow.

Template Parameters
Rrounding mode to use
Parameters
signhalf-precision value with sign bit only
Returns
rounded overflowing half-precision value
Exceptions
FE_OVERFLOW

Definition at line 801 of file includes/half.hpp.

References FE_OVERFLOW.

◆ pole()

HALF_CONSTEXPR_NOERR unsigned int half_float::detail::pole ( unsigned int  sign = 0)
inline

Raise pole error and return infinity.

Parameters
signhalf-precision value with sign bit only
Returns
half-precision infinity with sign of sign
Exceptions
FE_DIVBYZERO

Definition at line 772 of file includes/half.hpp.

References FE_DIVBYZERO.

Referenced by half_float::atanh(), half_float::lgamma(), half_float::log(), half_float::log10(), half_float::log1p(), half_float::log2(), half_float::logb(), half_float::operator/(), half_float::pow(), half_float::rsqrt(), and half_float::tgamma().

◆ raise()

void half_float::detail::raise ( int   HALF_UNUSED_NOERRflags,
bool   HALF_UNUSED_NOERRcond = true 
)
inline

Raise floating-point exception.

Parameters
flagsexceptions to raise
condcondition to raise exceptions for

Definition at line 642 of file includes/half.hpp.

References errflags(), FE_DIVBYZERO, FE_INEXACT, FE_INVALID, FE_OVERFLOW, FE_UNDERFLOW, and half_float::feraiseexcept().

Referenced by half_float::feraiseexcept(), half_float::ilogb(), half_float::nextafter(), and half_float::nexttoward().

◆ rounded()

template<std::float_round_style R, bool I>
HALF_CONSTEXPR_NOERR unsigned int half_float::detail::rounded ( unsigned int  value,
int  g,
int  s 
)

Round half-precision number.

Template Parameters
Rrounding mode to use
Itrue to always raise INEXACT exception, false to raise only for rounded results
Parameters
valuefinite half-precision number to round
gguard bit (most significant discarded bit)
ssticky bit (or of all but the most significant discarded bits)
Returns
rounded half-precision value
Exceptions
FE_OVERFLOWon overflows
FE_UNDERFLOWon underflows
FE_INEXACTif value had to be rounded or I is true

Definition at line 837 of file includes/half.hpp.

References FE_INEXACT, FE_OVERFLOW, FE_UNDERFLOW, and HALF_ERRHANDLING_UNDERFLOW_TO_INEXACT.

◆ select()

HALF_CONSTEXPR_NOERR unsigned int half_float::detail::select ( unsigned int  x,
unsigned int   HALF_UNUSED_NOERRy 
)
inline

Select value or signaling NaN.

Parameters
xpreferred half-precision value
yignored half-precision value except for signaling NaN
Returns
y if signaling NaN, x otherwise
Exceptions
FE_INVALIDif y is signaling NaN

Definition at line 748 of file includes/half.hpp.

References signal().

Referenced by half_float::fmax(), half_float::fmin(), half_float::hypot(), and half_float::pow().

◆ sign_mask()

uint32 half_float::detail::sign_mask ( uint32  arg)
inline

Platform-independent sign mask.

Parameters
arginteger value in two's complement
Return values
-1if arg negative
0if arg positive

Definition at line 608 of file includes/half.hpp.

Referenced by atan2(), half_float::cbrt(), fixed2half(), half_float::log2(), log2_post(), half_float::pow(), sincos(), and half_float::tan().

◆ signal() [1/3]

◆ signal() [2/3]

HALF_CONSTEXPR_NOERR unsigned int half_float::detail::signal ( unsigned int  x,
unsigned int  y 
)
inline

Signal and silence signaling NaNs.

Parameters
xfirst half-precision value to check
ysecond half-precision value to check
Returns
quiet NaN
Exceptions
FE_INVALIDif x or y is signaling NaN

Definition at line 721 of file includes/half.hpp.

References FE_INVALID.

◆ signal() [3/3]

HALF_CONSTEXPR_NOERR unsigned int half_float::detail::signal ( unsigned int  x,
unsigned int  y,
unsigned int  z 
)
inline

Signal and silence signaling NaNs.

Parameters
xfirst half-precision value to check
ysecond half-precision value to check
zthird half-precision value to check
Returns
quiet NaN
Exceptions
FE_INVALIDif x, y or z is signaling NaN

Definition at line 735 of file includes/half.hpp.

References FE_INVALID.

◆ sincos()

std::pair< uint32, uint32 > half_float::detail::sincos ( uint32  mz,
unsigned int  n = 31 
)
inline

Fixed point sine and cosine.

This uses the CORDIC algorithm in rotation mode.

Parameters
mzangle in [-pi/2,pi/2] as Q1.30
nnumber of iterations (at most 31)
Returns
sine and cosine of mz as Q1.30

Definition at line 1575 of file includes/half.hpp.

References arithmetic_shift(), and sign_mask().

Referenced by half_float::cos(), gamma(), half_float::sin(), half_float::sincos(), and half_float::tan().

◆ sqrt()

template<unsigned int F>
uint32 half_float::detail::sqrt ( uint32 &  r,
int &  exp 
)

Fixed point square root.

Template Parameters
Fnumber of fractional bits
Parameters
rradicand in Q1.F fixed point format
expexponent
Returns
square root as Q1.F/2

Definition at line 1497 of file includes/half.hpp.

References half_float::exp().

Referenced by CV_FUNCS::computeSearchRegion(), TrackerVizOutput::drawUncertaintyEllipse(), and rs2::vec3d::length().

◆ tangent_post()

template<std::float_round_style R>
unsigned int half_float::detail::tangent_post ( uint32  my,
uint32  mx,
int  exp,
unsigned int  sign = 0 
)

Division and postprocessing for tangents.

Template Parameters
Rrounding mode to use
Parameters
mydividend as Q1.31
mxdivisor as Q1.31
expbiased exponent of result
signsign bit of result
Returns
quotient converted to half-precision
Exceptions
FE_OVERFLOWon overflows
FE_UNDERFLOWon underflows
FE_INEXACTif no other exception occurred

Definition at line 1784 of file includes/half.hpp.

References divide64(), and half_float::exp().

◆ underflow()

template<std::float_round_style R>
HALF_CONSTEXPR_NOERR unsigned int half_float::detail::underflow ( unsigned int  sign = 0)

Half-precision underflow.

Template Parameters
Rrounding mode to use
Parameters
signhalf-precision value with sign bit only
Returns
rounded underflowing half-precision value
Exceptions
FE_UNDERFLOW

Definition at line 817 of file includes/half.hpp.

References FE_UNDERFLOW.

Variable Documentation

◆ binary

HALF_CONSTEXPR_CONST binary_t half_float::detail::binary = binary_t()

Tag for binary construction.

Definition at line 553 of file includes/half.hpp.

Referenced by half_float::acos(), half_float::acosh(), half_float::asin(), half_float::asinh(), half_float::atan(), half_float::atan2(), half_float::atanh(), half_float::cbrt(), half_float::ceil(), half_float::copysign(), half_float::cos(), half_float::cosh(), std::numeric_limits< half_float::half >::denorm_min(), std::numeric_limits< half_float::half >::epsilon(), half_float::erf(), half_float::erfc(), half_float::exp(), half_float::exp2(), half_float::expm1(), half_float::fabs(), half_float::fdim(), half_float::floor(), half_float::fma(), half_float::fmax(), half_float::fmin(), half_float::fmod(), half_float::frexp(), half_float::hypot(), std::numeric_limits< half_float::half >::infinity(), half_float::lgamma(), half_float::log(), half_float::log10(), half_float::log1p(), half_float::log2(), half_float::logb(), std::numeric_limits< half_float::half >::lowest(), std::numeric_limits< half_float::half >::max(), std::numeric_limits< half_float::half >::min(), half_float::modf(), half_float::nanh(), half_float::nearbyint(), half_float::nextafter(), half_float::nexttoward(), half_float::operator*(), half_float::operator+(), half_float::half::operator++(), half_float::operator-(), half_float::half::operator--(), half_float::operator/(), half_float::pow(), std::numeric_limits< half_float::half >::quiet_NaN(), read_tensor_from_file(), TrackerInt8EntropyCalibrator::readCalibrationCache(), ds3d::readFile(), half_float::remainder(), half_float::remquo(), half_float::rint(), half_float::round(), std::numeric_limits< half_float::half >::round_error(), half_float::rsqrt(), half_float::scalbln(), std::numeric_limits< half_float::half >::signaling_NaN(), half_float::sin(), half_float::sincos(), half_float::sinh(), half_float::sqrt(), half_float::tan(), half_float::tanh(), half_float::tgamma(), and half_float::trunc().