|
Universal Numbers Library C++ API
sw::universal -- header-only custom arithmetic types (posit, cfloat, lns, fixpnt, dd/qd, and more)
|
TrackedStatistical provides fast, approximate error tracking using ULP statistics. More...
#include <tracked_statistical.hpp>
Public Types | |
| using | value_type = T |
Public Member Functions | |
| constexpr | TrackedStatistical () noexcept |
| Default constructor: zero value. | |
| TrackedStatistical (T v) noexcept | |
| Construct from value (exact, no error yet). | |
| TrackedStatistical (T v, double ulp_err, size_t ops) noexcept | |
| Construct with known error state. | |
| constexpr | TrackedStatistical (const TrackedStatistical &) noexcept=default |
| constexpr | TrackedStatistical (TrackedStatistical &&) noexcept=default |
| constexpr TrackedStatistical & | operator= (const TrackedStatistical &) noexcept=default |
| constexpr TrackedStatistical & | operator= (TrackedStatistical &&) noexcept=default |
| template<typename U> | |
| TrackedStatistical & | operator= (U v) noexcept |
| T | value () const noexcept |
| Get the computed value. | |
| double | ulp_error () const noexcept |
| Get accumulated ULP error estimate. | |
| size_t | operations () const noexcept |
| Get total operation count. | |
| operator T () const noexcept | |
| Implicit conversion to underlying type. | |
| double | error () const noexcept |
| Get absolute error estimate. | |
| double | relative_error () const noexcept |
| Get relative error estimate. | |
| double | valid_bits () const noexcept |
| Estimate valid bits of precision, clamped to [0, the type's mantissa]. | |
| bool | is_exact () const noexcept |
| Check if value is still considered exact (no operations performed). | |
| TrackedStatistical | operator+ (const TrackedStatistical &rhs) const |
| TrackedStatistical | operator- (const TrackedStatistical &rhs) const |
| TrackedStatistical | operator- () const |
| TrackedStatistical | operator* (const TrackedStatistical &rhs) const |
| TrackedStatistical | operator/ (const TrackedStatistical &rhs) const |
| TrackedStatistical & | operator+= (const TrackedStatistical &rhs) |
| TrackedStatistical & | operator-= (const TrackedStatistical &rhs) |
| TrackedStatistical & | operator*= (const TrackedStatistical &rhs) |
| TrackedStatistical & | operator/= (const TrackedStatistical &rhs) |
| bool | operator< (const TrackedStatistical &rhs) const noexcept |
| bool | operator> (const TrackedStatistical &rhs) const noexcept |
| bool | operator<= (const TrackedStatistical &rhs) const noexcept |
| bool | operator>= (const TrackedStatistical &rhs) const noexcept |
| bool | operator== (const TrackedStatistical &rhs) const noexcept |
| bool | operator!= (const TrackedStatistical &rhs) const noexcept |
| bool | definitely_different (const TrackedStatistical &rhs) const noexcept |
| Are values definitely different (non-overlapping error regions)? | |
| bool | possibly_equal (const TrackedStatistical &rhs) const noexcept |
| Could values be equal (overlapping error regions)? | |
| void | report (std::ostream &os) const |
Static Public Member Functions | |
| static constexpr const char * | model_name () noexcept |
| Get the error model name. | |
| static constexpr const char * | strategy_name () noexcept |
| Get strategy name. | |
| static double | combine_errors (double err1, double err2, double op_cost) noexcept |
| Combine errors from two operands plus new operation error. | |
| static double | add_operation_error (double current_err, double op_cost) noexcept |
| Add new operation error to existing error. | |
Static Public Attributes | |
| static constexpr ErrorModel | model = Model |
| static constexpr double | ADD_COST = 0.5 |
| static constexpr double | MUL_COST = 0.5 |
| static constexpr double | DIV_COST = 0.5 |
| static constexpr double | SQRT_COST = 0.5 |
| static constexpr double | TRANS_COST = 1.0 |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const TrackedStatistical &v) |
TrackedStatistical provides fast, approximate error tracking using ULP statistics.
| T | The underlying scalar type (float, double, long double) |
| Model | Error accumulation model (RandomWalk or Linear) |
Error is estimated based on operation count and the statistical model, without computing actual reference values. This makes it very fast but only provides estimates, not exact errors.
| using sw::universal::TrackedStatistical< T, Model >::value_type = T |
|
inlineconstexprnoexcept |
Default constructor: zero value.
|
inlinenoexcept |
Construct from value (exact, no error yet).
|
inlinenoexcept |
Construct with known error state.
|
constexprdefaultnoexcept |
|
constexprdefaultnoexcept |
|
inlinestaticnoexcept |
Add new operation error to existing error.
|
inlinestaticnoexcept |
Combine errors from two operands plus new operation error.
|
inlinenoexcept |
Are values definitely different (non-overlapping error regions)?
|
inlinenoexcept |
Get absolute error estimate.
A non-finite value has no ULP to scale by, so the error is unbounded rather than the NaN that ulp(inf) used to produce (#1546).
|
inlinenoexcept |
Check if value is still considered exact (no operations performed).
|
inlinestaticconstexprnoexcept |
Get the error model name.
|
inlinenoexcept |
Get total operation count.
|
inlinenoexcept |
Implicit conversion to underlying type.
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
constexprdefaultnoexcept |
|
constexprdefaultnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Could values be equal (overlapping error regions)?
|
inlinenoexcept |
Get relative error estimate.
|
inline |
|
inlinestaticconstexprnoexcept |
Get strategy name.
|
inlinenoexcept |
Get accumulated ULP error estimate.
|
inlinenoexcept |
Estimate valid bits of precision, clamped to [0, the type's mantissa].
|
inlinenoexcept |
Get the computed value.
|
friend |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |