Skip to content

Class scalar_constants

class scalar_constants<T> simd

template <typename T>
struct scalar_constants { … }

Collection of mathematical and machine constants for the scalar type T .

Template parameters
T The scalar numeric type (e.g. float , double ).

function pi_s(int, int)

constexpr static T pi_s(int m, int d = 1) { … }

Returns π scaled by m / d .

Parameters
m Numerator multiplier.
d Denominator divisor (defaults to 1).
Returns
pi * m / d .

Fully qualified name: kfr::scalar_constants<T>::pi_s(int, int)

Declared at simd/constants.hpp:75

function recip_pi_s(int, int)

constexpr static T recip_pi_s(int m, int d = 1) { … }

Returns the reciprocal of π scaled by m / d .

Parameters
m Numerator multiplier.
d Denominator divisor (defaults to 1).
Returns
recip_pi * m / d .

Fully qualified name: kfr::scalar_constants<T>::recip_pi_s(int, int)

Declared at simd/constants.hpp:82

variable pi

constexpr static T pi = static_cast<T>(3.1415926535897932384626433832795)

The mathematical constant π (pi).

Template parameters
T The numeric type.

Fully qualified name: kfr::scalar_constants<T>::pi

Declared at simd/constants.hpp:88

variable sqr_pi

constexpr static T sqr_pi = static_cast<T>(9.8696044010893586188344909998762)

The square of π (pi²).

Template parameters
T The numeric type.

Fully qualified name: kfr::scalar_constants<T>::sqr_pi

Declared at simd/constants.hpp:94

variable recip_pi

constexpr static T recip_pi = static_cast<T>(0.31830988618379067153776752674503)

The reciprocal of π (1/π).

Template parameters
T The numeric type.

Fully qualified name: kfr::scalar_constants<T>::recip_pi

variable degtorad

constexpr static T degtorad = static_cast<T>(pi / 180)

Degrees to radians conversion factor (π / 180).

Template parameters
T The numeric type.

Fully qualified name: kfr::scalar_constants<T>::degtorad

variable radtodeg

constexpr static T radtodeg = static_cast<T>(pi * 180)

Radians to degrees conversion factor (π * 180).

Template parameters
T The numeric type.

Fully qualified name: kfr::scalar_constants<T>::radtodeg

variable e

constexpr static T e = static_cast<T>(2.718281828459045235360287471352662)

The mathematical constant e (Euler's number).

Template parameters
T The numeric type.

Fully qualified name: kfr::scalar_constants<T>::e

variable recip_log_2

constexpr static T recip_log_2 = static_cast<T>(1.442695040888963407359924681001892137426645954)

The reciprocal of the natural logarithm of 2 (1 / ln(2)).

Template parameters
T The numeric type.

Fully qualified name: kfr::scalar_constants<T>::recip_log_2

variable recip_log_10

constexpr static T recip_log_10 = static_cast<T>(0.43429448190325182765112891891661)

The reciprocal of the natural logarithm of 10 (1 / ln(10)).

Template parameters
T The numeric type.

Fully qualified name: kfr::scalar_constants<T>::recip_log_10

variable log_2

constexpr static T log_2 = static_cast<T>(0.69314718055994530941723212145818)

The natural logarithm of 2 (ln(2)).

Template parameters
T The numeric type.

Fully qualified name: kfr::scalar_constants<T>::log_2

variable log_10

constexpr static T log_10 = static_cast<T>(2.3025850929940456840179914546844)

The natural logarithm of 10 (ln(10)).

Template parameters
T The numeric type.

Fully qualified name: kfr::scalar_constants<T>::log_10

variable sqrt_2

constexpr static T sqrt_2 = static_cast<T>(1.4142135623730950488016887242097)

The square root of 2 (√2).

Template parameters
T The numeric type.

Fully qualified name: kfr::scalar_constants<T>::sqrt_2

variable fold_constant_div

constexpr static T fold_constant_div = choose_const<T>(
    KFR_FP(0x1.921fb6p-1f, 7.8539818525e-01f), KFR_FP(0x1.921fb54442d18p-1, 7.853981633974482790e-01))

Constant π/2 used as the folding divisor in trigonometric argument reduction.

Fully qualified name: kfr::scalar_constants<T>::fold_constant_div

variable fold_constant_hi

constexpr static T fold_constant_hi = choose_const<T>(
    KFR_FP(0x1.922000p-1f, 7.8540039062e-01f), KFR_FP(0x1.921fb40000000p-1, 7.853981256484985352e-01))

High part of the π/2 folding constant (Cody-Waite reduction).

Fully qualified name: kfr::scalar_constants<T>::fold_constant_hi

variable fold_constant_rem1

constexpr static T fold_constant_rem1 =
    choose_const<T>(KFR_FP(-0x1.2ae000p-19f, -2.2267922759e-06f),
                    KFR_FP(0x1.4442d00000000p-25, 3.774894707930798177e-08))

First remainder term of the π/2 folding constant (Cody-Waite reduction).

Fully qualified name: kfr::scalar_constants<T>::fold_constant_rem1

variable fold_constant_rem2

constexpr static T fold_constant_rem2 =
    choose_const<T>(KFR_FP(-0x1.de973ep-32f, -4.3527578764e-10f),
                    KFR_FP(0x1.8469898cc5170p-49, 2.695151429079059484e-15))

Second remainder term of the π/2 folding constant (Cody-Waite reduction).

Fully qualified name: kfr::scalar_constants<T>::fold_constant_rem2

variable epsilon

constexpr static T epsilon = std::numeric_limits<T>::epsilon()

The machine epsilon — the smallest value such that 1 + epsilon ≠ 1.

Template parameters
T The numeric type.

Fully qualified name: kfr::scalar_constants<T>::epsilon

variable infinity

constexpr static T infinity = std::numeric_limits<T>::infinity()

The representation of positive infinity for the type T.

Template parameters
T The numeric type.

Fully qualified name: kfr::scalar_constants<T>::infinity

variable neginfinity

constexpr static T neginfinity = -std::numeric_limits<T>::infinity()

The representation of negative infinity for the type T.

Template parameters
T The numeric type.

Fully qualified name: kfr::scalar_constants<T>::neginfinity

variable qnan

constexpr static T qnan = std::numeric_limits<T>::quiet_NaN()

A quiet NaN (Not-a-Number) value for the type T. This value does not raise floating-point exceptions.

Template parameters
T The numeric type.

Fully qualified name: kfr::scalar_constants<T>::qnan

Fully qualified name: kfr::scalar_constants<T>

Declared at simd/constants.hpp:67

This file was generated by cxxdox, a C++ documentation generator based on MkDocs Material and libclang.