Dedekind 0.0.0
A structuralist C++23 Module Library
Loading...
Searching...
No Matches
approx.cppm File Reference

Approximation policies for the IEEE effect context. More...

#include <cmath>
#include <concepts>
#include <limits>
#include <utility>
import dedekind.ieee;
import dedekind.category;
Include dependency graph for approx.cppm:

Classes

struct  dedekind::ieee::Approx< F >
 Approximation envelope for an IEEE value. More...
struct  dedekind::ieee::ReportErrorPolicy< F >
 Report policy: keep value and attach an error envelope. More...
struct  dedekind::ieee::IgnoreErrorPolicy< F >
 Ignore policy: run fast lane and drop all diagnostics. More...
struct  dedekind::ieee::AdaptiveErrorPolicy< F >
 Adaptive policy: respond to risky regions via ternary status. More...

Concepts

concept  dedekind::ieee::IsIEEEPropagationOp
 Category-grounded contract for propagation operation tokens.

Enumerations

enum class  dedekind::ieee::NumericRegion { Regular , NearZero , Huge , NonFinite }
 Region tags for simple runtime numeric diagnostics.

Functions

template<std::floating_point F = double>
constexpr NumericRegion dedekind::ieee::classify_region (F x, F near_zero_scale=F{64}, F huge_scale=F{0.5}) noexcept
 Classify a scalar into a numeric region.
template<std::floating_point F = double>
constexpr F dedekind::ieee::roundoff_proxy (F x) noexcept
 Conservative local rounding proxy: eps*|x|.
template<std::floating_point F, typename Op>
requires IsIEEEPropagationOp<Op, F>
constexpr Approx< F > dedekind::ieee::propagate (const Approx< F > &a, const Approx< F > &b, const Op &op={}) noexcept
 Propagate approximation error through a binary IEEE operation.
template<std::floating_point F = double>
constexpr Approx< F > dedekind::ieee::demo_propagate_add (const Approx< F > &a, const Approx< F > &b) noexcept
 Demo: propagate error through IEEE addition.
template<std::floating_point F = double>
constexpr Approx< F > dedekind::ieee::demo_propagate_mul (const Approx< F > &a, const Approx< F > &b) noexcept
 Demo: propagate error through IEEE multiplication.
template<std::floating_point F = double>
constexpr IEEE< F > dedekind::ieee::demo_add_ignore (const IEEE< F > &a, const IEEE< F > &b) noexcept
template<std::floating_point F = double>
constexpr Approx< F > dedekind::ieee::demo_add_report (const IEEE< F > &a, const IEEE< F > &b) noexcept
 Demo operation: IEEE add under report policy.
template<std::floating_point F = double>
constexpr TernaryResult< Approx< F > > dedekind::ieee::demo_add_adaptive (const IEEE< F > &a, const IEEE< F > &b) noexcept
 Demo operation: IEEE add under adaptive policy.

Detailed Description

Approximation policies for the IEEE effect context.

Note
"Begin with the simplest examples." – David Hilbert, quoted in Hilbert-Courant (1984)