pub struct ComputableReal { /* private fields */ }Expand description
A computable real number (Level 3 of the tower).
Implementations§
Source§impl ComputableReal
impl ComputableReal
Sourcepub fn evaluate(&self, precision: u64) -> RnsRational
pub fn evaluate(&self, precision: u64) -> RnsRational
Approximate to precision decimal places, memoizing the result.
The cache is keyed by precision but a cached entry with key ≥ request
satisfies the ask (a 50-digit enclosure answers a 10-digit query), so we
reuse the tightest already-computed result instead of recomputing.
Sourcepub fn enclose(&self, precision: u64) -> Ball
pub fn enclose(&self, precision: u64) -> Ball
A rigorous Ball of width < 2·10^(-precision) containing this number.
This is the Archimedean (Level-3) face of the value: ordering, sign, and
magnitude on computable reals all flow through the returned Ball, the
same type the algebraic layer uses for sign-of-a-root. Because the oracle
contract guarantees |value - evaluate(p)| < 10^(-p), padding the rational
midpoint by that radius yields a certified enclosure that composes
rigorously under Ball interval arithmetic.
Sourcepub fn evaluate_f64(&self) -> f64
pub fn evaluate_f64(&self) -> f64
Convenience: evaluate at roughly f64 precision.
Sourcepub fn from_rational(r: RnsRational) -> Self
pub fn from_rational(r: RnsRational) -> Self
A constant rational.
Sourcepub fn from_algebraic(a: AlgebraicNumber) -> Self
pub fn from_algebraic(a: AlgebraicNumber) -> Self
Drop a Level-2 algebraic number down to Level 3 for digit production.
Sourcepub fn sqrt(r: RnsRational) -> Self
pub fn sqrt(r: RnsRational) -> Self
√r by Newton’s method on rationals (quadratic convergence).
Sourcepub fn exp(r: RnsRational) -> Self
pub fn exp(r: RnsRational) -> Self
exp(r) via the Taylor series Σ rᵏ/k!.
Sourcepub fn ln(r: RnsRational) -> Self
pub fn ln(r: RnsRational) -> Self
ln(r) for r > 0 via 2·atanh((r-1)/(r+1)).
Trait Implementations§
Source§impl Clone for ComputableReal
impl Clone for ComputableReal
Source§fn clone(&self) -> ComputableReal
fn clone(&self) -> ComputableReal
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ComputableReal
impl !UnwindSafe for ComputableReal
impl Freeze for ComputableReal
impl Send for ComputableReal
impl Sync for ComputableReal
impl Unpin for ComputableReal
impl UnsafeUnpin for ComputableReal
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more