What provenance must accompany computed mathematical constants to survive floating-point drift?
**Date of Record:** 2026 October 27 **Scope:** Applies when an agentic session computes or uses mathematical constants (pi, e, specific rationals) as part of numerical reasoning, and the constant's computed value must survive floating-point drift between generations or environments. Does not apply to symbolic computation systems that preserve exact values, or sessions where constants are used only for approximate comparisons.
Core Distinction
The separation between **computed value** (the specific float32/float64 representation the agent produced) and **symbolic provenance** (the exact mathematical definition of the constant, independent of any numerical representation). Relying on the computed value creates the **Precision Drift Divergence**: the predecessor computes pi as `3.141592653589793` in float64, the successor computes it as `3.1415927410125732` in float32, and the two sessions produce different results for the same mathematical operation, breaking reproducibility.
What Was Observed
In numerical agent architectures, failing to preserve symbolic provenance produces three primary failure modes:
- **Reproducibility Break:** The agent's numerical experiments cannot be reproduced because the constants were computed with different precision.
- **Comparison Collapse:** Two agents compare their computed values of the same constant and conclude they disagree, when the underlying mathematics is identical and only the representation differs.
- **Boundary Violation:** A critical threshold comparison (e.g., "is x > pi?") produces different results across environments because of precision differences near the threshold.
Recorded Elements
- **`symbolic_definition_hash`:** The hash of the exact symbolic definition of the constant (e.g., "pi = circumference/diameter", or a series expansion), independent of numerical representation.
- **`precision_class_signature`:** The exact floating-point type and precision used to compute the value (e.g., `float32`, `float64`, `float128`), paired with the computation algorithm.
- **`computation_method_receipt`:** The cryptographic proof of the algorithm used to compute the constant (e.g., Machin's formula, Chudnovsky algorithm), since different algorithms yield different numerical approximations.
- **`comparison_tolerance_receipt`:** The exact tolerance used when comparing the computed value to thresholds or to other agents' computed values, ensuring comparisons are precision-aware.
Condition of Validity
* **Applies when:** The agent computes or uses mathematical constants numerically, and downstream reasoning depends on consistent numerical behavior across sessions or environments. * **Does not apply when:** The agent uses symbolic mathematics (e.g., SymPy) that preserves exact values, or the constants are used only for approximate heuristic comparisons with generous tolerances.
Decision Boundary
- **Is the constant computed numerically rather than symbolically?** If symbolic, standard symbolic provenance applies. If numeric, proceed.
- **Is the `symbolic_definition_hash` and `precision_class_signature` recorded alongside the value?** If no, the value cannot be compared across environments. The agent must record symbolic provenance before using the constant.
- **Are two values being compared across precisions?** If yes, the comparison must use the `comparison_tolerance_receipt`, not direct float equality.
- **Conversely, when can an agent skip symbolic provenance?** Only when the constant is used in contexts that are insensitive to precision differences (e.g., comparisons with tolerance > 1e-6), or the agent is strictly self-contained with no cross-environment dependencies.
Operational Effect
- **Precision Consistency:** Enables reproducible numerical results across different precision environments.
- **Precision-Aware Comparison:** Prevents false mismatches by using tolerance-based comparison.
- **Threshold Safety:** Prevents boundary violations from precision differences.
from dataclasses import dataclass
from enum import Enum, auto
import hashlib
import json
import math
class PrecisionVerdict(Enum):
SYMBOLIC_PROVENANCE_PRESENT = auto()
PRECISION_MISMATCH = auto()
COMPARISON_WITHIN_TOLERANCE = auto()
COMPARISON_EXCEEDS_TOLERANCE = auto()
@dataclass(frozen=True)
class ComputedConstant:
constant_id: str
computed_value: float
precision_class: str
symbolic_definition_hash: str
comparison_tolerance: float
@dataclass(frozen=True)
class PrecisionPolicy:
max_precision_delta: float
@dataclass(frozen=True)
class PrecisionManifest:
verdict: PrecisionVerdict
directive: str
manifest_digest: str
class MathematicalConstantGuard:
@staticmethod
def _hash(data: str) -> str:
return hashlib.sha256(data.encode("utf-8")).hexdigest()
@classmethod
def evaluate_constant(
cls, current: ComputedConstant, previous: ComputedConstant | None, policy: PrecisionPolicy
) -> PrecisionManifest:
# Gate 1: Symbolic provenance
if not current.symbolic_definition_hash:
return PrecisionManifest(
verdict=PrecisionVerdict.PRECISION_MISMATCH,
directive=f"HALT: Constant {current.constant_id} lacks symbolic provenance.",
manifest_digest=cls._hash(f"NO_SYMBOLIC:{current.constant_id}")
)
# Gate 2: No comparison target
if previous is None:
digest = cls._hash(json.dumps({
"constant": current.constant_id,
"value": f"{current.computed_value:.17g}",
"precision": current.precision_class,
"symbolic": current.symbolic_definition_hash
}, sort_keys=True))
return PrecisionManifest(
verdict=PrecisionVerdict.SYMBOLIC_PROVENANCE_PRESENT,
directive=f"PROCEED: Symbolic provenance present for {current.constant_id}.",
manifest_digest=digest
)
# Gate 3: Symbolic definition match
if current.symbolic_definition_hash != previous.symbolic_definition_hash:
return PrecisionManifest(
verdict=PrecisionVerdict.PRECISION_MISMATCH,
directive=f"HALT: Symbolic definitions differ for {current.constant_id}.",
manifest_digest=cls._hash(f"SYMBOLIC_DIFF:{current.constant_id}")
)
# Gate 4: Compare within tolerance
delta = abs(current.computed_value - previous.computed_value)
tolerance = max(current.comparison_tolerance, previous.comparison_tolerance)
if delta <= tolerance:
digest = cls._hash(json.dumps({
"constant": current.constant_id,
"delta": f"{delta:.17g}",
"tolerance": f"{tolerance:.17g}",
"comparison": "WITHIN_TOLERANCE"
}, sort_keys=True))
return PrecisionManifest(
verdict=PrecisionVerdict.COMPARISON_WITHIN_TOLERANCE,
directive=f"PROCEED: Delta {delta:.2e} within tolerance {tolerance:.2e}.",
manifest_digest=digest
)
# Gate 5: Exceeds tolerance
return PrecisionManifest(
verdict=PrecisionVerdict.COMPARISON_EXCEEDS_TOLERANCE,
directive=f"HALT: Delta {delta:.2e} > tolerance {tolerance:.2e}. Precision drift exceeds policy.",
manifest_digest=cls._hash(f"EXCEEDS:{delta:.17g}")
)