Hermes
hermes::EFloat Class Reference

Represents a value with error bounds. More...

Public Member Functions

HERMES_DEVICE_CALLABLE EFloat ()
 Default constructor.
 
HERMES_DEVICE_CALLABLE EFloat (f32 v, f32 e=0.f)
 Constructs from value and error size. More...
 
HERMES_DEVICE_CALLABLE operator float () const
 Casts to 32 bit floating point. More...
 
HERMES_DEVICE_CALLABLE operator double () const
 Casts to 64 bit floating point. More...
 
HERMES_DEVICE_CALLABLE EFloat operator+ (EFloat f) const
 
HERMES_DEVICE_CALLABLE EFloat operator- (EFloat f) const
 
HERMES_DEVICE_CALLABLE EFloat operator* (EFloat f) const
 
HERMES_DEVICE_CALLABLE EFloat operator/ (EFloat f) const
 
HERMES_DEVICE_CALLABLE bool operator== (EFloat f) const
 
HERMES_DEVICE_CALLABLE f32 absoluteError () const
 Computes the absolute error carried by this number. More...
 
HERMES_DEVICE_CALLABLE f32 upperBound () const
 Computes the upper error bound carried by this number. More...
 
HERMES_DEVICE_CALLABLE f32 lowerBound () const
 Computes the lower error bound carried by this number. More...
 

Friends

HERMES_DEVICE_CALLABLE friend EFloat operator* (f32 f, EFloat fe)
 
HERMES_DEVICE_CALLABLE friend EFloat operator/ (f32 f, EFloat fe)
 
HERMES_DEVICE_CALLABLE friend EFloat operator+ (f32 f, EFloat fe)
 
HERMES_DEVICE_CALLABLE friend EFloat operator- (f32 f, EFloat fe)
 

Detailed Description

Represents a value with error bounds.

Implements the running error analysis by carrying the error bounds accumulated by a floating point value. It keeps track of the interval of uncertainty of the computed value.

Constructor & Destructor Documentation

◆ EFloat()

HERMES_DEVICE_CALLABLE hermes::EFloat::EFloat ( f32  v,
f32  e = 0.f 
)
inlineexplicit

Constructs from value and error size.

Parameters
vfloating point value
eabsolute error bound

Member Function Documentation

◆ absoluteError()

HERMES_DEVICE_CALLABLE float hermes::EFloat::absoluteError ( ) const
inline

Computes the absolute error carried by this number.

Returns
a bound for the absolute error

◆ lowerBound()

HERMES_DEVICE_CALLABLE float hermes::EFloat::lowerBound ( ) const
inline

Computes the lower error bound carried by this number.

Returns
upper error interval bound

◆ operator double()

HERMES_DEVICE_CALLABLE hermes::EFloat::operator double ( ) const
inlineexplicit

Casts to 64 bit floating point.

Returns

◆ operator float()

HERMES_DEVICE_CALLABLE hermes::EFloat::operator float ( ) const
inlineexplicit

Casts to 32 bit floating point.

Returns

◆ upperBound()

HERMES_DEVICE_CALLABLE float hermes::EFloat::upperBound ( ) const
inline

Computes the upper error bound carried by this number.

Returns
lower error interval bound

The documentation for this class was generated from the following files: