functions Struct Reference

functions Struct Reference#

half: half_float::detail::functions Struct Reference
half_float::detail::functions Struct Reference

Wrapper implementing unspecialized half-precision functions. More...

#include <half.hpp>

Static Public Member Functions

static expr plus (float x, float y)
 Addition implementation. More...
 
static expr minus (float x, float y)
 Subtraction implementation. More...
 
static expr multiplies (float x, float y)
 Multiplication implementation. More...
 
static expr divides (float x, float y)
 Division implementation. More...
 
template<typename charT , typename traits >
static std::basic_ostream< charT, traits > & write (std::basic_ostream< charT, traits > &out, float arg)
 Output implementation. More...
 
template<typename charT , typename traits >
static std::basic_istream< charT, traits > & read (std::basic_istream< charT, traits > &in, half &arg)
 Input implementation. More...
 
static expr fmod (float x, float y)
 Modulo implementation. More...
 
static expr remainder (float x, float y)
 Remainder implementation. More...
 
static expr remquo (float x, float y, int *quo)
 Remainder implementation. More...
 
static expr fdim (float x, float y)
 Positive difference implementation. More...
 
static expr fma (float x, float y, float z)
 Fused multiply-add implementation. More...
 
static half nanh ()
 Get NaN. More...
 
static expr exp (float arg)
 Exponential implementation. More...
 
static expr expm1 (float arg)
 Exponential implementation. More...
 
static expr exp2 (float arg)
 Binary exponential implementation. More...
 
static expr log (float arg)
 Logarithm implementation. More...
 
static expr log10 (float arg)
 Common logarithm implementation. More...
 
static expr log1p (float arg)
 Logarithm implementation. More...
 
static expr log2 (float arg)
 Binary logarithm implementation. More...
 
static expr sqrt (float arg)
 Square root implementation. More...
 
static expr cbrt (float arg)
 Cubic root implementation. More...
 
static expr hypot (float x, float y)
 Hypotenuse implementation. More...
 
static expr pow (float base, float exp)
 Power implementation. More...
 
static expr sin (float arg)
 Sine implementation. More...
 
static expr cos (float arg)
 Cosine implementation. More...
 
static expr tan (float arg)
 Tan implementation. More...
 
static expr asin (float arg)
 Arc sine implementation. More...
 
static expr acos (float arg)
 Arc cosine implementation. More...
 
static expr atan (float arg)
 Arc tangent implementation. More...
 
static expr atan2 (float x, float y)
 Arc tangent implementation. More...
 
static expr sinh (float arg)
 Hyperbolic sine implementation. More...
 
static expr cosh (float arg)
 Hyperbolic cosine implementation. More...
 
static expr tanh (float arg)
 Hyperbolic tangent implementation. More...
 
static expr asinh (float arg)
 Hyperbolic area sine implementation. More...
 
static expr acosh (float arg)
 Hyperbolic area cosine implementation. More...
 
static expr atanh (float arg)
 Hyperbolic area tangent implementation. More...
 
static expr erf (float arg)
 Error function implementation. More...
 
static expr erfc (float arg)
 Complementary implementation. More...
 
static expr lgamma (float arg)
 Gamma logarithm implementation. More...
 
static expr tgamma (float arg)
 Gamma implementation. More...
 
static half floor (half arg)
 Floor implementation. More...
 
static half ceil (half arg)
 Ceiling implementation. More...
 
static half trunc (half arg)
 Truncation implementation. More...
 
static half round (half arg)
 Nearest integer implementation. More...
 
static long lround (half arg)
 Nearest integer implementation. More...
 
static half rint (half arg)
 Nearest integer implementation. More...
 
static long lrint (half arg)
 Nearest integer implementation. More...
 
static long long llround (half arg)
 Nearest integer implementation. More...
 
static long long llrint (half arg)
 Nearest integer implementation. More...
 
static half frexp (half arg, int *exp)
 Decompression implementation. More...
 
static half modf (half arg, half *iptr)
 Decompression implementation. More...
 
static half scalbln (half arg, long exp)
 Scaling implementation. More...
 
static int ilogb (half arg)
 Exponent implementation. More...
 
static half logb (half arg)
 Exponent implementation. More...
 
static half nextafter (half from, half to)
 Enumeration implementation. More...
 
static half nexttoward (half from, long double to)
 Enumeration implementation. More...
 
static half copysign (half x, half y)
 Sign implementation. More...
 
static int fpclassify (half arg)
 Classification implementation. More...
 
static bool isfinite (half arg)
 Classification implementation. More...
 
static bool isinf (half arg)
 Classification implementation. More...
 
static bool isnan (half arg)
 Classification implementation. More...
 
static bool isnormal (half arg)
 Classification implementation. More...
 
static bool signbit (half arg)
 Sign bit implementation. More...
 
static bool isequal (half x, half y)
 Comparison implementation. More...
 
static bool isnotequal (half x, half y)
 Comparison implementation. More...
 
static bool isgreater (half x, half y)
 Comparison implementation. More...
 
static bool isgreaterequal (half x, half y)
 Comparison implementation. More...
 
static bool isless (half x, half y)
 Comparison implementation. More...
 
static bool islessequal (half x, half y)
 Comparison implementation. More...
 
static bool islessgreater (half x, half y)
 Comparison implementation. More...
 
static bool isunordered (half x, half y)
 Comparison implementation. More...
 

Static Private Member Functions

static double erf (double arg)
 
static double lgamma (double arg)
 

Detailed Description

Wrapper implementing unspecialized half-precision functions.

Definition at line 1206 of file half.hpp.

Member Function Documentation

◆ plus()

static expr half_float::detail::functions::plus ( float  x,
float  y 
)
inlinestatic

Addition implementation.

Parameters
xfirst operand
ysecond operand
Returns
Half-precision sum stored in single-precision

Definition at line 1212 of file half.hpp.

◆ minus()

static expr half_float::detail::functions::minus ( float  x,
float  y 
)
inlinestatic

Subtraction implementation.

Parameters
xfirst operand
ysecond operand
Returns
Half-precision difference stored in single-precision

Definition at line 1218 of file half.hpp.

◆ multiplies()

static expr half_float::detail::functions::multiplies ( float  x,
float  y 
)
inlinestatic

Multiplication implementation.

Parameters
xfirst operand
ysecond operand
Returns
Half-precision product stored in single-precision

Definition at line 1224 of file half.hpp.

◆ divides()

static expr half_float::detail::functions::divides ( float  x,
float  y 
)
inlinestatic

Division implementation.

Parameters
xfirst operand
ysecond operand
Returns
Half-precision quotient stored in single-precision

Definition at line 1230 of file half.hpp.

◆ write()

template<typename charT , typename traits >
static std::basic_ostream<charT,traits>& half_float::detail::functions::write ( std::basic_ostream< charT, traits > &  out,
float  arg 
)
inlinestatic

Output implementation.

Parameters
outstream to write to
argvalue to write
Returns
reference to stream

Definition at line 1236 of file half.hpp.

◆ read()

template<typename charT , typename traits >
static std::basic_istream<charT,traits>& half_float::detail::functions::read ( std::basic_istream< charT, traits > &  in,
half arg 
)
inlinestatic

Input implementation.

Parameters
instream to read from
arghalf to read into
Returns
reference to stream

Definition at line 1242 of file half.hpp.

◆ fmod()

static expr half_float::detail::functions::fmod ( float  x,
float  y 
)
inlinestatic

Modulo implementation.

Parameters
xfirst operand
ysecond operand
Returns
Half-precision division remainder stored in single-precision

Definition at line 1254 of file half.hpp.

◆ remainder()

static expr half_float::detail::functions::remainder ( float  x,
float  y 
)
inlinestatic

Remainder implementation.

Parameters
xfirst operand
ysecond operand
Returns
Half-precision division remainder stored in single-precision

Definition at line 1260 of file half.hpp.

◆ remquo()

static expr half_float::detail::functions::remquo ( float  x,
float  y,
int *  quo 
)
inlinestatic

Remainder implementation.

Parameters
xfirst operand
ysecond operand
quoaddress to store quotient bits at
Returns
Half-precision division remainder stored in single-precision

Definition at line 1291 of file half.hpp.

◆ fdim()

static expr half_float::detail::functions::fdim ( float  x,
float  y 
)
inlinestatic

Positive difference implementation.

Parameters
xfirst operand
ysecond operand
Returns
Positive difference stored in single-precision

Definition at line 1337 of file half.hpp.

◆ fma()

static expr half_float::detail::functions::fma ( float  x,
float  y,
float  z 
)
inlinestatic

Fused multiply-add implementation.

Parameters
xfirst operand
ysecond operand
zthird operand
Returns
x * y + z stored in single-precision

Definition at line 1351 of file half.hpp.

◆ nanh()

static half half_float::detail::functions::nanh ( )
inlinestatic

Get NaN.

Returns
Half-precision quiet NaN

Definition at line 1362 of file half.hpp.

◆ exp()

static expr half_float::detail::functions::exp ( float  arg)
inlinestatic

Exponential implementation.

Parameters
argfunction argument
Returns
function value stored in single-preicision

Definition at line 1367 of file half.hpp.

◆ expm1()

static expr half_float::detail::functions::expm1 ( float  arg)
inlinestatic

Exponential implementation.

Parameters
argfunction argument
Returns
function value stored in single-preicision

Definition at line 1372 of file half.hpp.

◆ exp2()

static expr half_float::detail::functions::exp2 ( float  arg)
inlinestatic

Binary exponential implementation.

Parameters
argfunction argument
Returns
function value stored in single-preicision

Definition at line 1384 of file half.hpp.

◆ log()

static expr half_float::detail::functions::log ( float  arg)
inlinestatic

Logarithm implementation.

Parameters
argfunction argument
Returns
function value stored in single-preicision

Definition at line 1396 of file half.hpp.

◆ log10()

static expr half_float::detail::functions::log10 ( float  arg)
inlinestatic

Common logarithm implementation.

Parameters
argfunction argument
Returns
function value stored in single-preicision

Definition at line 1401 of file half.hpp.

◆ log1p()

static expr half_float::detail::functions::log1p ( float  arg)
inlinestatic

Logarithm implementation.

Parameters
argfunction argument
Returns
function value stored in single-preicision

Definition at line 1406 of file half.hpp.

◆ log2()

static expr half_float::detail::functions::log2 ( float  arg)
inlinestatic

Binary logarithm implementation.

Parameters
argfunction argument
Returns
function value stored in single-preicision

Definition at line 1418 of file half.hpp.

◆ sqrt()

static expr half_float::detail::functions::sqrt ( float  arg)
inlinestatic

Square root implementation.

Parameters
argfunction argument
Returns
function value stored in single-preicision

Definition at line 1430 of file half.hpp.

◆ cbrt()

static expr half_float::detail::functions::cbrt ( float  arg)
inlinestatic

Cubic root implementation.

Parameters
argfunction argument
Returns
function value stored in single-preicision

Definition at line 1435 of file half.hpp.

◆ hypot()

static expr half_float::detail::functions::hypot ( float  x,
float  y 
)
inlinestatic

Hypotenuse implementation.

Parameters
xfirst argument
ysecond argument
Returns
function value stored in single-preicision

Definition at line 1451 of file half.hpp.

◆ pow()

static expr half_float::detail::functions::pow ( float  base,
float  exp 
)
inlinestatic

Power implementation.

Parameters
basevalue to exponentiate
exppower to expontiate to
Returns
function value stored in single-preicision

Definition at line 1465 of file half.hpp.

◆ sin()

static expr half_float::detail::functions::sin ( float  arg)
inlinestatic

Sine implementation.

Parameters
argfunction argument
Returns
function value stored in single-preicision

Definition at line 1470 of file half.hpp.

◆ cos()

static expr half_float::detail::functions::cos ( float  arg)
inlinestatic

Cosine implementation.

Parameters
argfunction argument
Returns
function value stored in single-preicision

Definition at line 1475 of file half.hpp.

◆ tan()

static expr half_float::detail::functions::tan ( float  arg)
inlinestatic

Tan implementation.

Parameters
argfunction argument
Returns
function value stored in single-preicision

Definition at line 1480 of file half.hpp.

◆ asin()

static expr half_float::detail::functions::asin ( float  arg)
inlinestatic

Arc sine implementation.

Parameters
argfunction argument
Returns
function value stored in single-preicision

Definition at line 1485 of file half.hpp.

◆ acos()

static expr half_float::detail::functions::acos ( float  arg)
inlinestatic

Arc cosine implementation.

Parameters
argfunction argument
Returns
function value stored in single-preicision

Definition at line 1490 of file half.hpp.

◆ atan()

static expr half_float::detail::functions::atan ( float  arg)
inlinestatic

Arc tangent implementation.

Parameters
argfunction argument
Returns
function value stored in single-preicision

Definition at line 1495 of file half.hpp.

◆ atan2()

static expr half_float::detail::functions::atan2 ( float  x,
float  y 
)
inlinestatic

Arc tangent implementation.

Parameters
xfirst argument
ysecond argument
Returns
function value stored in single-preicision

Definition at line 1501 of file half.hpp.

◆ sinh()

static expr half_float::detail::functions::sinh ( float  arg)
inlinestatic

Hyperbolic sine implementation.

Parameters
argfunction argument
Returns
function value stored in single-preicision

Definition at line 1506 of file half.hpp.

◆ cosh()

static expr half_float::detail::functions::cosh ( float  arg)
inlinestatic

Hyperbolic cosine implementation.

Parameters
argfunction argument
Returns
function value stored in single-preicision

Definition at line 1511 of file half.hpp.

◆ tanh()

static expr half_float::detail::functions::tanh ( float  arg)
inlinestatic

Hyperbolic tangent implementation.

Parameters
argfunction argument
Returns
function value stored in single-preicision

Definition at line 1516 of file half.hpp.

◆ asinh()

static expr half_float::detail::functions::asinh ( float  arg)
inlinestatic

Hyperbolic area sine implementation.

Parameters
argfunction argument
Returns
function value stored in single-preicision

Definition at line 1521 of file half.hpp.

◆ acosh()

static expr half_float::detail::functions::acosh ( float  arg)
inlinestatic

Hyperbolic area cosine implementation.

Parameters
argfunction argument
Returns
function value stored in single-preicision

Definition at line 1533 of file half.hpp.

◆ atanh()

static expr half_float::detail::functions::atanh ( float  arg)
inlinestatic

Hyperbolic area tangent implementation.

Parameters
argfunction argument
Returns
function value stored in single-preicision

Definition at line 1545 of file half.hpp.

◆ erf()

static expr half_float::detail::functions::erf ( float  arg)
inlinestatic

Error function implementation.

Parameters
argfunction argument
Returns
function value stored in single-preicision

Definition at line 1557 of file half.hpp.

◆ erfc()

static expr half_float::detail::functions::erfc ( float  arg)
inlinestatic

Complementary implementation.

Parameters
argfunction argument
Returns
function value stored in single-preicision

Definition at line 1569 of file half.hpp.

◆ lgamma()

static expr half_float::detail::functions::lgamma ( float  arg)
inlinestatic

Gamma logarithm implementation.

Parameters
argfunction argument
Returns
function value stored in single-preicision

Definition at line 1581 of file half.hpp.

◆ tgamma()

static expr half_float::detail::functions::tgamma ( float  arg)
inlinestatic

Gamma implementation.

Parameters
argfunction argument
Returns
function value stored in single-preicision

Definition at line 1603 of file half.hpp.

◆ floor()

static half half_float::detail::functions::floor ( half  arg)
inlinestatic

Floor implementation.

Parameters
argvalue to round
Returns
rounded value

Definition at line 1627 of file half.hpp.

◆ ceil()

static half half_float::detail::functions::ceil ( half  arg)
inlinestatic

Ceiling implementation.

Parameters
argvalue to round
Returns
rounded value

Definition at line 1632 of file half.hpp.

◆ trunc()

static half half_float::detail::functions::trunc ( half  arg)
inlinestatic

Truncation implementation.

Parameters
argvalue to round
Returns
rounded value

Definition at line 1637 of file half.hpp.

◆ round()

static half half_float::detail::functions::round ( half  arg)
inlinestatic

Nearest integer implementation.

Parameters
argvalue to round
Returns
rounded value

Definition at line 1642 of file half.hpp.

◆ lround()

static long half_float::detail::functions::lround ( half  arg)
inlinestatic

Nearest integer implementation.

Parameters
argvalue to round
Returns
rounded value

Definition at line 1647 of file half.hpp.

◆ rint()

static half half_float::detail::functions::rint ( half  arg)
inlinestatic

Nearest integer implementation.

Parameters
argvalue to round
Returns
rounded value

Definition at line 1652 of file half.hpp.

◆ lrint()

static long half_float::detail::functions::lrint ( half  arg)
inlinestatic

Nearest integer implementation.

Parameters
argvalue to round
Returns
rounded value

Definition at line 1657 of file half.hpp.

◆ llround()

static long long half_float::detail::functions::llround ( half  arg)
inlinestatic

Nearest integer implementation.

Parameters
argvalue to round
Returns
rounded value

Definition at line 1663 of file half.hpp.

◆ llrint()

static long long half_float::detail::functions::llrint ( half  arg)
inlinestatic

Nearest integer implementation.

Parameters
argvalue to round
Returns
rounded value

Definition at line 1668 of file half.hpp.

◆ frexp()

static half half_float::detail::functions::frexp ( half  arg,
int *  exp 
)
inlinestatic

Decompression implementation.

Parameters
argnumber to decompress
expaddress to store exponent at
Returns
normalized significant

Definition at line 1675 of file half.hpp.

◆ modf()

static half half_float::detail::functions::modf ( half  arg,
half iptr 
)
inlinestatic

Decompression implementation.

Parameters
argnumber to decompress
iptraddress to store integer part at
Returns
fractional part

Definition at line 1688 of file half.hpp.

◆ scalbln()

static half half_float::detail::functions::scalbln ( half  arg,
long  exp 
)
inlinestatic

Scaling implementation.

Parameters
argnumber to scale
exppower of two to scale by
Returns
scaled number

Definition at line 1708 of file half.hpp.

◆ ilogb()

static int half_float::detail::functions::ilogb ( half  arg)
inlinestatic

Exponent implementation.

Parameters
argnumber to query
Returns
floating point exponent

Definition at line 1755 of file half.hpp.

◆ logb()

static half half_float::detail::functions::logb ( half  arg)
inlinestatic

Exponent implementation.

Parameters
argnumber to query
Returns
floating point exponent

Definition at line 1775 of file half.hpp.

◆ nextafter()

static half half_float::detail::functions::nextafter ( half  from,
half  to 
)
inlinestatic

Enumeration implementation.

Parameters
fromnumber to increase/decrease
todirection to enumerate into
Returns
next representable number

Definition at line 1803 of file half.hpp.

◆ nexttoward()

static half half_float::detail::functions::nexttoward ( half  from,
long double  to 
)
inlinestatic

Enumeration implementation.

Parameters
fromnumber to increase/decrease
todirection to enumerate into
Returns
next representable number

Definition at line 1821 of file half.hpp.

◆ copysign()

static half half_float::detail::functions::copysign ( half  x,
half  y 
)
inlinestatic

Sign implementation.

Parameters
xfirst operand
ysecond operand
Returns
composed value

Definition at line 1837 of file half.hpp.

◆ fpclassify()

static int half_float::detail::functions::fpclassify ( half  arg)
inlinestatic

Classification implementation.

Parameters
argvalue to classify
Return values
trueif infinite number
falseelse

Definition at line 1843 of file half.hpp.

◆ isfinite()

static bool half_float::detail::functions::isfinite ( half  arg)
inlinestatic

Classification implementation.

Parameters
argvalue to classify
Return values
trueif finite number
falseelse

Definition at line 1853 of file half.hpp.

◆ isinf()

static bool half_float::detail::functions::isinf ( half  arg)
inlinestatic

Classification implementation.

Parameters
argvalue to classify
Return values
trueif infinite number
falseelse

Definition at line 1859 of file half.hpp.

◆ isnan()

static bool half_float::detail::functions::isnan ( half  arg)
inlinestatic

Classification implementation.

Parameters
argvalue to classify
Return values
trueif not a number
falseelse

Definition at line 1865 of file half.hpp.

◆ isnormal()

static bool half_float::detail::functions::isnormal ( half  arg)
inlinestatic

Classification implementation.

Parameters
argvalue to classify
Return values
trueif normal number
falseelse

Definition at line 1871 of file half.hpp.

◆ signbit()

static bool half_float::detail::functions::signbit ( half  arg)
inlinestatic

Sign bit implementation.

Parameters
argvalue to check
Return values
trueif signed
falseif unsigned

Definition at line 1877 of file half.hpp.

◆ isequal()

static bool half_float::detail::functions::isequal ( half  x,
half  y 
)
inlinestatic

Comparison implementation.

Parameters
xfirst operand
ysecond operand
Return values
trueif operands equal
falseelse

Definition at line 1884 of file half.hpp.

◆ isnotequal()

static bool half_float::detail::functions::isnotequal ( half  x,
half  y 
)
inlinestatic

Comparison implementation.

Parameters
xfirst operand
ysecond operand
Return values
trueif operands not equal
falseelse

Definition at line 1891 of file half.hpp.

◆ isgreater()

static bool half_float::detail::functions::isgreater ( half  x,
half  y 
)
inlinestatic

Comparison implementation.

Parameters
xfirst operand
ysecond operand
Return values
trueif x > y
falseelse

Definition at line 1898 of file half.hpp.

◆ isgreaterequal()

static bool half_float::detail::functions::isgreaterequal ( half  x,
half  y 
)
inlinestatic

Comparison implementation.

Parameters
xfirst operand
ysecond operand
Return values
trueif x >= y
falseelse

Definition at line 1909 of file half.hpp.

◆ isless()

static bool half_float::detail::functions::isless ( half  x,
half  y 
)
inlinestatic

Comparison implementation.

Parameters
xfirst operand
ysecond operand
Return values
trueif x < y
falseelse

Definition at line 1920 of file half.hpp.

◆ islessequal()

static bool half_float::detail::functions::islessequal ( half  x,
half  y 
)
inlinestatic

Comparison implementation.

Parameters
xfirst operand
ysecond operand
Return values
trueif x <= y
falseelse

Definition at line 1931 of file half.hpp.

◆ islessgreater()

static bool half_float::detail::functions::islessgreater ( half  x,
half  y 
)
inlinestatic

Comparison implementation.

Parameters
xfirst operand
ysecond operand
Return values
trueif either x > y nor x < y
falseelse

Definition at line 1942 of file half.hpp.

◆ isunordered()

static bool half_float::detail::functions::isunordered ( half  x,
half  y 
)
inlinestatic

Comparison implementation.

Parameters
xfirst operand
ysecond operand
Return values
trueif operand unordered
falseelse

Definition at line 1956 of file half.hpp.


The documentation for this struct was generated from the following file:
  • /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-half/checkouts/latest/include/half.hpp