1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//! # adele-ring — exact multi-base arithmetic engine
//!
//! `adele-ring` carries every number at **two kinds of place at once**. The
//! *finite places* (an adaptive residue-number system over a prime [`Basis`])
//! do all the real arithmetic: carry-free, local, embarrassingly parallel across
//! CPU lanes and GPU threads, and free of big-integer work. The *infinite place*
//! (a rigorous real interval, [`Ball`]) answers every question the prime channels
//! constitutionally cannot — sign, comparison, magnitude, and decimal output — by
//! refining on demand. Exactness is recovered by reconstructing from the finite
//! places, with the basis grown to exactly the height the computation provably
//! needs ([`bounds`]), so a result can never silently exceed its range. Big
//! integers appear only at that reconstruction boundary, for an instant, on
//! numbers as large as the answer's own information content — the product formula
//! reminding us that what we save among the primes we pay, once, at infinity.
//!
//! This pairing is the [`Adelic`] carrier, the data-structure form of
//! `𝔸_ℚ = ℝ × ∏′_p ℚ_p`. On top of the RNS substrate sits a *number tower* that
//! keeps every value at the cheapest exact level it can.
//!
//! On top of the RNS substrate sits a *number tower* that keeps every value at
//! the cheapest exact level it can:
//!
//! | Level | Set | Type |
//! |-------|----------|------------------------------|
//! | 0 | ℤ | [`rns::RnsInt`] |
//! | 1 | ℚ | [`rational::RnsRational`] |
//! | 2 | ℚ̄ | [`algebraic::AlgebraicNumber`] |
//! | 3 | ℝ_c | [`computable::ComputableReal`] |
//! | 4 | 𝒮 | [`symbolic::SymbolicExpr`] |
//!
//! The crate name uses a hyphen (`adele-ring`) but the Rust path uses an
//! underscore (`adele_ring`), per Rust's identifier rules.
/// Channel-count threshold above which single-value operations parallelize over
/// channels with rayon. Below it, sequential is faster (task overhead ~50ns vs
/// channel op ~1ns: break-even around 8–16 channels).
pub const RAYON_CHANNEL_THRESHOLD: usize = 16;
// ── Foundation: the adelic carrier (finite places × the real place) ──────────
// ── Parallelism foundation ───────────────────────────────────────────────────
// ── The number tower ─────────────────────────────────────────────────────────
pub use ;
pub use ;
pub use ;
pub use Ball;
pub use Basis;
pub use RnsBatch;
pub use ;
pub use ;
pub use ;
pub use ;
pub use RnsRational;
pub use rational_reconstruct;
pub use ;
pub use ;
pub use ;