ThreeBody and Rational Dimensions
A deep look into the cheat of softening, finite-precision accumulators, and our ThreeBody astrodynamics design
There is a myth that systems without neat analytical solutions are fundamentally unsolvable. Yet, entire industries are built on integrating these chaotic, multi-component realities. Molecular biologists routinely simulate the highly non-linear -body interactions of atomic forces to model targeted medication delivery. Structural engineers rely on finite-element and particle simulations to predict the cascade of sheer stress through skyscrapers. Aviation relies on millions of interacting fluid cells to keep aircraft aloft. In all of these fields, “mathematical non-integrability” is simply a given, a theoretical constraint bypassed entirely by rigorous numerical approximation.
In the specialized world of aerospace, flight and mission-control teams propagate multi-body trajectories every day. Cislunar near-rectilinear halo orbits, station-keeping maneuver plans, resonant Jovian moon tours, and low-energy ballistic transfers all live in multi-body gravitational fields. When popular accounts call ’the three-body problem’ intractable they conflate non-integrability with numerical intractability. Bruns’s theorem rules out additional independent algebraic first integrals beyond the ten classical ones in the spatial Newtonian problem: total energy , three components of linear momentum , three of angular momentum , and three center-of-mass integrals. Poincaré’s non-existence results concern additional analytic integrals under their stated perturbative hypotheses rather than placing a blanket prohibition on every analytic representation of a solution. After fixing center-of-mass motion, the remaining classical integrals are and the three components of in space, or and in a plane. Operational ground software integrates the equations routinely, provided the engineer is honest about force-model assumptions, close-approach singularities, step truncation, and finite-precision rounding.
Keep that last condition in mind: honesty about models, singularities, and rounding is a central takeaway of this piece.

At Braidpoint, we started the ThreeBody project as a concrete astrodynamics and compiler verification testbed for the Clef programming language and Composer compiler. With that, the ThreeBody project and the rational measure-exponent extension described below remain active design work. Writing the design down at full mathematical resolution forces our numerical, physical, and type-level commitments to apply rigor in layers before we lay claim to any result.
This is a deep cut, as they say, written primarily with two readers in mind: generalist software engineers curious how type systems and custom silicon handle nasty numerical edge cases, and specialists who wrestle with complex domains such as astrodynamics. Working through the hardest cases in the compiler and their result at runtime is how we make demanding numeric domains approachable, if not routine, across a wide variety of high-precision workloads. For the next several sections, the treatment is unapologetically mathematical with a few signposts along the way.
To begin, we consider point masses with positions (), momenta , pairwise separations , and Euclidean distances . Their motion is governed by the Newtonian Hamiltonian and the exact pairwise gravitational force on body .
Our baseline ThreeBody configuration places three equal masses at the vertices of a right triangle in a two-dimensional plane (a symmetric-mass cousin of Carl Burrau’s 3-4-5 free-fall problem integrated numerically by Victor Szebehely and C. Frederick Peters in 1967) and releases them from rest, so and . Choosing characteristic scales , , and dynamical time with momentum scale normalizes the dimensionless coupling to while preserving explicit physical units at every interface. Such cold starts can produce repeated close passages and binary-escaper outcomes, stressing the force kernel and arithmetic. The actual outcome depends on the triangle and must be established for the chosen initial data.
Anyone who has watched 3 Body Problem on Netflix will recognize dramatized variants of this chaotic dance. Three masses released from rest on a right triangle give us the clean laboratory version.
Softening: Vlasov Continua & Point Masses
Many published -body examples replace the Newtonian force factor with a Plummer-softened pair potential energy and force kernel controlled by a length parameter .
Across introductory -body demos, GPU benchmarks, and discrete-body examples, adding in the denominator often appears with no physical justification at all. When slipped in purely as a numerical crutch so close approaches do not blow up, it silently replaces Newton’s inverse-square law with a different force model whenever two bodies pass near one another.
Before throwing softening out completely, it helps to separate the one continuum setting where smoothing plays a statistical role from discrete astrodynamics where it corrupts the physics. In collisionless components of galactic and cosmological codes (GADGET, AREPO, GIZMO), simulation particles represent coarse samples of a smooth six-dimensional phase-space mass density rather than individual stars or spacecraft. In physical coordinates, its Newtonian mean-field evolution follows the Vlasov-Poisson equations below, where denotes gravitational potential per unit mass rather than the pair potential energy above.
When one computational particle carries solar masses of dark matter or stellar mass, hard scattering between neighboring tracer particles is a discretization artifact of coarse phase-space sampling. Softening reduces shot-noise fluctuations in the estimated force, trading sampling variance against force bias without simply eliminating artificial two-body relaxation (Dehnen, 2001). Hayes’s shadowing experiments found substantially shorter shadow lifetimes with insufficient softening in the configurations studied. Those results motivate choosing smoothing and resolution together when approximating a collisionless continuum rather than treating softening as a fundamental physical force law.
Point-mass astrodynamics has no such statistical excuse. Three discrete gravitating bodies in free fall, a spacecraft executing a powered perilune pass, or a resonant asteroid triplet are genuine point-mass or small-body systems rather than tracer samples of a fluid. Close encounters are the dynamics under study. Injecting integrates a perturbed Plummer Hamiltonian instead of Newtonian gravity. Inside , the true force magnification collapses into a linear harmonic core.
That core caps peak accelerations, alters deflection angles during flybys, and removes the singular growth of force derivatives near zero separation. Even so, the softened model remains Hamiltonian rather than introducing physical dissipation.
Hard-coding rSq + 1e-12 can also hide a change of physical model from domain checks. Because holds everywhere on , a positivity proof for the softened denominator is valid, yet that proof establishes safety of the softened expression rather than fidelity to Newtonian point-mass gravity. The constant must also carry the same squared-length unit as rSq.
The pole at disappears because the force law has changed. If the program promises unsoftened gravity, that change requires a model-equivalence or error-budget check beyond denominator safety. In trajectory code, unbudgeted softening can alter a flyby’s outbound asymptote without triggering a divide-by-zero diagnostic. Addressing that gap cleanly, with both precision and execution efficiency intact, motivates how we split simulation regimes below.
Separated Regimes and Collisional Trajectories
Because no single numerical formula is valid across smooth continuum sampling, separated orbital flight, singular point-mass flybys, and physical surface impacts, our simulation plan separates non-colliding and colliding regimes explicitly as opposed to simply hiding both behind softening.
Non-Colliding Point Masses and Error-Bounded Far Fields
For non-colliding point-mass runs (Phase 1 of ThreeBody), we evaluate the exact unsoftened kernel over an explicit minimum-separation domain .
Without a positive lower separation bound, is unbounded above, and Composer’s planned range checker under Numeric Selection must refuse fixed-scale accumulator commitment. A bound can come from a checked separation invariant or an explicit runtime guard on every force evaluation. An evaluation outside the admitted domain halts or requests a close-encounter regime instead of inventing a denominator floor. Those guards certify sampled evaluations, whereas guaranteeing separation throughout an accepted step additionally requires a continuous-trajectory bound or validated event isolation so an interior crossing cannot slip between stages.
Scaling non-colliding trajectories to large follows the same discipline. Our multi-body scaling design uses the Fast Multipole Method, originating with Greengard and Rokhlin and extended to adaptive trees by Carrier, Greengard, and Rokhlin. The bound below applies to the three-dimensional Newtonian kernel. For nonnegative source masses totaling inside a sphere of radius , and a target at center distance , truncating the spherical-harmonic expansion after degree bounds the remainder in potential per unit target mass.
A potential-error target chooses from this bound, including its mass and distance prefactor. Force accuracy requires a separate bound on the differentiated expansion, together with translation, summation, and rounding budgets, since the potential tolerance alone does not certify force error. In the usual adaptive FMM terminology, List V uses multipole-to-local translations, List W evaluates multipoles at targets, and List X contributes sources to local expansions. Our design targets that far-field work for vector hardware, while near-field List U evaluates neighboring sources directly. Direct evaluation retains the unsoftened kernel while still incurring finite-precision arithmetic error. Planar trajectories embedded in physical three-space retain the three-dimensional Newtonian force and use the three-dimensional potential kernel rather than the two-dimensional logarithmic Laplace potential , which governs infinite line masses. Where a user genuinely intends collisionless Vlasov continuum smoothing, Plummer or spline potentials remain available as distinct force laws with their own typed parameter .
Software generalists can read FMM’s List V and List U split as a classic systems pattern: batch the far field onto vector hardware, and evaluate nearby interactions directly. Ground-system engineers will recognize a related separation in conjunction screening, where bulk catalog propagation filters thousands of resident space objects down to the few close-approach pairs requiring high-fidelity evaluation.
Analytic Regularization and Finite-Radius Contact
A separation guard keeps a non-colliding integrator honest, yet stopping at cannot propagate through a deep perilune, a resonant three-body scramble, or an actual collision. Supporting colliding and near-colliding simulations requires distinguishing two physical cases: singular point-mass encounters () and finite-radius physical contact ().
For an isolated binary collision, or a close pair whose external perturbation remains regular, celestial mechanics removes the Keplerian pole analytically while agreeing with Newton’s law away from collision. If you have never worked with regularized astrodynamics, the core idea is surprisingly visual: we re-clock integration so physical time increments shrink with distance (), and lift coordinates through a quadratic map. A head-on binary collision can then continue smoothly through the origin in the lifted coordinates, whereas an ordinary non-colliding flyby stays away from that origin. Levi-Civita regularization uses complex squaring in the plane, while the Kustaanheimo-Stiefel construction lifts relative Cartesian coordinates (embedded in with fourth component zero) to a four-parameter vector paired with Sundman’s fictitious time . This binary construction does not by itself regularize a simultaneous triple collision.
The Kustaanheimo-Stiefel (KS) linear operator takes the matrix form below.
This matrix satisfies . Along trajectories obeying the bilinear gauge constraint (which reduces in the planar slice to Levi-Civita’s matrix), it maps differentials via .
Write , let , and, for , define the pair’s osculating specific two-body energy . At collision, is continued by its differential equation rather than evaluated as this quotient. The vector below collects differential tidal acceleration from external bodies , embedded as when multiplied by the KS matrix.
Substituting and into the singular relative equation cancels the pole algebraically and yields the regular KS equations of motion.
For a bound pair () in isolation (), the equation is a linear harmonic oscillator with constant real frequency measured against fictitious time . A head-on collision at () has a smooth regularized continuation with finite derivatives in . In our planned multi-body architecture, inspired by Aarseth’s use of regularized subsystems, actor-scheduled neighbor tracking switches eligible pairs crossing into regularized coordinates and restores Cartesian coordinates once they separate past hysteresis radius . Simultaneous close encounters require their own subsystem treatment.
Finite-radius bodies (), modeled here as spheres or enclosing keep-out volumes, follow a different branch: contact or keep-out violation occurs at before the point-mass pole. Within , a transversal approaching contact satisfies and , where . Ordinary dense-output root finding estimates , whereas certifying the earliest physical contact requires validated bracketing and dense-output error bounds. At the resolved event, rules select a mission-level response, inelastic accretion (, at the pair barycenter), or normal impulse exchange with restitution along .
For an approaching, frictionless spherical contact, a partially inelastic normal impulse () changes translational kinetic energy by .
A merger is different: replacing both translational velocities by the barycentric velocity removes from translational kinetic energy, including tangential relative motion. Its model must account separately for retained spin, internal energy, and changes in gravitational potential energy. Dissipation breaks time-reversal invariance physically rather than numerically. In our verification design, reversal diagnostics apply across conservative segments (or strictly elastic event-resolved rebounds), while dissipative collisions check linear momentum, angular momentum including spin transfer, and the appropriate energy budget. Grazing contacts, initially overlapping bodies, and simultaneous contacts need explicit event rules beyond the approaching-contact formula.
Rational Dimensions & Astrodynamics
Look closely at the physical dimensions inside the regularized KS equations above. In unregularized Cartesian coordinates, computing Euclidean distance sqrt (dx*dx + dy*dy + dz*dz) maps back to , staying entirely within integer unit exponents. The moment a trajectory switches into Levi-Civita or Kustaanheimo-Stiefel coordinates, fractional dimensions enter the state vector itself.
Over base dimensions of length , mass , and time , the identity with assigns both the KS state vector and the entries of the fractional dimension . Sundman’s differential relation assigns fictitious time dimension . Differentiating with respect to gives regularized velocity dimension and regularized acceleration dimension . Every term of the perturbed KS oscillator balances cleanly in -exponents.
Fractional dimensions show up across everyday astrodynamics even before regularization:
- Gravitational root factors and vis-viva scaling: Standard gravitational parameter has dimension , so carries . Specific angular momentum multiplies by semi-latus rectum root () to land on .
- Keplerian period and mean motion: Orbital period divides by to yield , while mean motion yields .
- Universal variables: The universal anomaly , defined through , carries dimension . The Stumpff functions take a dimensionless argument (with of dimension ), while fractional dimensions belong to prefactors such as and rather than to the Stumpff functions themselves.
- Natural-unit nondimensionalization: Forming dynamical time and momentum scale from separate typed factors steps directly through half-integer exponents of and .
Calculating the Costs of Bare Floats
After wading through spherical harmonics and four-dimensional coordinate lifts, this is a good place to come up for air and look at what all of those fractional powers mean for someone actually writing and maintaining software.
Anyone who has worked on mission software stacks knows where unit bugs bite in production. Rarely does someone design to add meters directly to seconds inside a five-line helper. Instead, mismatches hide at subsystem handoffs where units were erased to bare double[] state vectors: passed in into a maneuver targeter expecting , or auxiliary universal-variable and KS state arrays whose fractional dimensions could not be expressed in the host language’s unit library.
That restriction comes from the unit algebra rather than the host-language family, as libraries such as Boost.Units already support rational exponents. In the integer-exponent calculus described by Andrew Kennedy, and in the Clef Units of Measure specification being extended here, primitive base measures generate the free abelian group . Every concrete measure carries an integer exponent vector , and sqrt : F<'U^2> -> F<'U> requires every exponent under the radical to be divisible by two. Taking the square root of or separation fails that divisibility condition.
When an integer-exponent checker rejects a valid fractional-dimensional intermediate, a common temptation is to strip the units off, run the math on raw floats, and reattach the expected unit by assertion. The first F# function below illustrates the risk of that erasure, while the second, correct function shows our proposed Clef notation for positive semi-major axis a and gravitational parameter mu. Keplerian period specifically can keep integer units without erasure by regrouping the radicand as 2.0 * Math.PI * sqrt (a * a * a / mu) (with units s^2), and current F# itself supports rational measures. Our proposed Clef extension lets fractional-dimensional intermediates stay explicit directly as written, including KS coordinates where period-specific regrouping cannot eliminate half-integer exponents.
[<Measure>] type m
[<Measure>] type s
// F# example: explicitly strip units, losing checks in the middle
let orbitalPeriodStripped (a: float<m>) (mu: float<m^3 / s^2>) : float<s> =
let rawA = float a
let rawMu = float mu
let rawT = 2.0 * Math.PI * sqrt rawMu / (rawA ** 1.5) // inverted ratio
rawT * 1.0<s>
// Proposed Clef rational (Q) exponents: retain measured intermediates
let orbitalPeriod (a: float<m>) (mu: float<m^3 / s^2>) : float<s> =
let rootA3 = pow_q<3, 2> a // inferred: float<m^(3/2)>
let rootMu = sqrt mu // inferred: float<m^(3/2) / s>
2.0 * Math.PI * (rootA3 / rootMu)Look at the failure mode inside orbitalPeriodStripped: the ratio is inverted. Physically that quotient represents inverse seconds (1/s), yet once erased to bare float, multiplying by 1.0<s> stamps seconds onto the result without checking dimensional consistency. In our proposed Clef -exponent version, flipping rootA3 / rootMu would infer float<s^-1>, conflicting immediately with the declared float<s> return type without an explicit annotation on either intermediate.
Why ℚ Calms the Compiler
Choosing which number system governs unit exponents is an engineering trade-off between expressiveness and what the compiler can decide automatically without pestering the programmer.
Integers () handle multiplication, division, and reciprocals (s^-1). A root of degree stays expressible in only when every measure exponent under the radical is divisible by , failing whenever division leaves a non-integral result rather than because a root is odd as such. The rational numbers (), ordinary fractions reduced by greatest common divisor, sit in the sweet spot: they cover every fractional power used above and admit exact representation inside the compiler as integer pairs with zero floating-point rounding. Allowing arbitrary real exponents would additionally require a symbolic real representation and equality procedure.
Extending measure exponents from to upgrades the measure sort from a -module () to a finite-dimensional vector space over the rationals.
Here is the pleasant surprise for language tooling: moving from to makes this equality-solving problem algebraically cleaner. For a fixed integer vector , is solvable over only when every component of is even, and general integer systems require divisibility reasoning. Over , every nonzero rational coefficient is invertible. Multiplication adds exponent vectors, division subtracts them, and a statically known rational power pow_q<p, d> scales them by , with . Measure equalities in this fragment therefore form linear systems over : exact Gaussian elimination decides consistency and, when consistent, yields a most-general parametric solution whose free-parameter choices describe the same solution family. That establishes principality for the measure-equality fragment itself, while surrounding language features and value-domain restrictions on roots and reciprocals carry their own separate obligations.
We are putting real care into how that algebra runs across design time and build time so developers get stronger guarantees without extra ceremony:
- At design time (inferred intermediate measures): The proposed extension would let Clef’s checker (
CCS) infer fractional units on local bindings, closures, and helper functions using these principal measure solutions. Developers would not need unit casts or manual proof hints on each intermediate, and dimensional mismatches should surface as normalized, human-readable exponents on the offending expression. Algebraic decidability guarantees that equality solving terminates, while interactive editor latency still requires implementation measurement. - At build time (Baker saturation): Clef’s Units of Measure architecture retains checked measures through Baker elaboration into the Program Semantic Graph (
Fidelity.PSG), so range analysis,cvc5domain checks, and accumulator-adequacy obligations can consume them. The rational extension preserves that path for fractional measures. Measures need no runtime wrapper or tag, provided erasure preserves the correspondence to checked operations, while required runtime domain guards and chosen numerical representations retain their own execution costs.
The goal is rich fractional units in the editor, checked obligations during compilation, and native arithmetic without runtime unit wrappers.
Decidable Obligations and Numeric Selection
A reader versed in formal methods might reasonably ask where the hidden proof burden sits. Unrestricted inference and proof search for rich value-dependent predicates are not generally decidable, although a dependently typed language can retain decidable checking of supplied terms (The Decidability Sweet Spot). How do we verify an unsoftened gravitational kernel and select hardware representations without requiring hand-authored proofs for every operation?
In our Decidable By Construction architecture, we avoid a monolithic dependent-type solver by organizing verification into tiers, from structural inference and local arithmetic checks to reusable domain and relational proofs. Checked mode shifts let established evidence serve as a premise in another reasoning discipline, preserving its assumptions and resource rules as proofs connect to the actual computation through lowering. We can imagine how those pieces meet in a prospective Clef pairwise encounter check. This sketch assumes rMin > 0.0<m> and finite caller-supplied bounds on positions and masses.
[<Measure>] type kg
[<Measure>] type N = kg * m / s^2
type Vec3<[<Measure>] 'u> = { X: float<'u>; Y: float<'u>; Z: float<'u> }
type EncounterRegime =
| SeparatedForce of Vec3<N>
| SwitchToRegularized of uNorm: float<m^(1/2)>
// Unsoftened point-mass pair check: no "+ 1e-12" hiding the pole.
// Measured quantities trigger range-coverage checks, and the r >= rMin
// guard bounds r^3 away from zero before representation selection.
let pairGravity
(rMin: float<m>)
(m1: float<kg>)
(m2: float<kg>)
(d: Vec3<m>) : EncounterRegime =
let g = 6.67430e-11<m^3 kg^-1 s^-2>
let rSq = d.X * d.X + d.Y * d.Y + d.Z * d.Z // inferred: float<m^2>
let r = sqrt rSq // inferred: float<m>
if r >= rMin then
let scale = (g * m1 * m2) / (r * rSq) // inferred: float<N / m>
SeparatedForce { X = scale * d.X; Y = scale * d.Y; Z = scale * d.Z }
else
SwitchToRegularized (sqrt r) // inferred: float<m^(1/2)>Notice that no concrete bitwidth or posit format (f64, bposit32) appears anywhere in pairGravity. Under our Numeric Selection specification, float<'u> denotes an abstract physical real quantity in source code, while concrete hardware encodings belong to Composer’s target catalog and platform boundary declarations. The design combines three mechanisms to check this example under its stated premises:
- Measured types trigger the range requirement: Under Numeric Selection, an unmeasured
floatwith an unobservable range may default to IEEEf64, whereas measured quantities require a bounded interval[a, b]before format commitment. That requirement surfaces missing bounds early, even though dimensions alone do not supply numeric intervals. The proposed rational solver would separately settle the measure equalities, includingfloat<m^(1/2)>onsqrt r. - Branch guards and interval enclosures bound the pole: Under the stated premises, real arithmetic gives
r * rSq >= rMin^3 > 0in the separated branch. Because those polynomial obligations multiply variables, they belong to quantifier-free nonlinear real arithmetic (QF_NRA) rather than linear arithmetic, withsqrt rSqcharacterized byr >= 0andr * r = rSq. Sound outward-rounded interval enclosures can establish useful bounds even without resolving every valid obligation, and machine realization must also account for rounding in the distance, guard, and denominator. The other branch returns a regularization request and the KS coordinate norm before evaluating the reciprocal, leaving the caller to construct a full constrained KS state from relative position, velocity, and masses with consistent gauge and energy initialization. - Representation choice is finite once admissibility is checked: Range coverage alone is insufficient. Each candidate in the target catalog must satisfy the operation and error contracts, and a quire must represent every inserted product at its quantum while covering every reachable partial sum and parallel merge. The design then selects the lowest-cost admissible format under its ULP-floored error metric, failing commitment whenever no candidate qualifies. A finite catalog keeps candidate enumeration finite without making arbitrary admissibility predicates decidable.
Keeping adjacent parts of our type system distinct prevents confusion as that pipeline comes together:
- Reciprocal units such as already belong to and need no extension.
- Rational measure exponents () check dimensional homogeneity across fractional roots, KS coordinates, and universal-variable formulas, carrying measured types through Baker saturation into the program semantic graph (Proofs from Dimensional Types).
- Negative and fractional types, discussed in A Path Less Traveled, type operational resource duals and directed channels as opposed to physical measure exponents or numerical reversibility.
The Lyapunov Horizon
Once the force law and coordinate domain are fixed, three arithmetic error mechanisms stand out within a broader error budget: coordinate subtraction, reductions, and state writeback. Force-kernel multiplication, division, and square roots also round, and time integration introduces its own truncation error alongside those three stages.
First comes pairwise coordinate subtraction . By Sterbenz’s lemma, finite same-sign floating-point values satisfying subtract exactly on their stored inputs, assuming the same binary format and gradual underflow. Zero cases are exact as well. Cancellation of leading bits during a close pass nonetheless exposes relative errors already accumulated in and across preceding steps.
Neither compensated summation nor a wide posit quire can reconstruct coordinate precision that vanished before the subtraction began.
Second comes non-associative reduction across squared norms , multi-body force sums , and energy or momentum tallies. In IEEE 754 binary64 ( significand bits, unit roundoff ), rounding after every addition breaks associativity.
Reordering force contributions across threads or tree nodes can change low-order bits. In distributed propagation pipelines, that non-associativity is one way two compute nodes replaying the same initial ephemeris with different reduction schedules can diverge on downstream maneuver targets or close-approach miss distances.
Third comes state writeback: even if an inner force sum or dot product is accumulated exactly, updating and rounds back to the working state width at the step boundary.
Our arithmetic construction and placement design compares three working-arithmetic paths with matched initial data and step sizes against a separately converged reference. The ordinary and compensated binary64 paths hold state width fixed while changing the reductions. The posit-plus-quire path changes both state representation and accumulation, so that comparison measures their combined effects:
- Uncompensated IEEE
binary64: standard double-precision evaluation with per-operation round-to-nearest-even semantics. - Compensated IEEE
binary64(TwoSum/ Kahan-Babuška-Neumaier): double-precision state storage with compensated force, norm, and diagnostic reductions. Error-free transforms recover local addition residuals, while the completed reduction still carries a rounding-error bound and dot products require separate product-error treatment. - Bounded posit
bposit32(eS = 5,rS = 6) with an 800-bit quire: 32-bit bounded-regime posit state storage paired with hardware exact accumulation on an Arty A7-100T FPGA sidecar over raw Layer 2 Ethernet via an eBPF interlink. - Convergence-checked high-precision reference: independent integration using MPFR arbitrary-precision floating point or Arb ball arithmetic, with both step-size and working-precision refinement so reference uncertainty stays well below the comparison tolerance over the reported interval. Ball arithmetic encloses discrete arithmetic, whereas a rigorous enclosure of the continuous trajectory additionally requires validated ODE truncation and remainder bounds.
Compensated binary64 serves as a mandatory experimental control. The complete TwoSum transformation captures the exact residual of an IEEE addition in a second register under round-to-nearest, no overflow, and gradual underflow. This local identity does not make an entire compensated reduction exact: accumulating the residuals can itself round (Ogita, Rump, and Oishi, 2005).
Measuring compensated binary64 alongside uncompensated binary64 tests how much drift the reduction changes remove on commodity IEEE hardware. Attributing a posit-path improvement specifically to the quire would additionally require a control with the same posit state format and different accumulation.
On the FPGA path, our ThreeBody plan uses the bounded-posit design, which caps regime width at six bits for parallel multiplexor decoding and specifies an 800-bit fixed-point quire (-bit words, distinct from the Posit Standard 2022 -bit quire for posit32). Under our posit arithmetic and Numeric Selection quire-adequacy contract, let contain valid finite accumulator states, excluding exceptional states such as NaR, with real denotation . Admitted insertions and merges obey these capacity-conditional accumulation and finalization identities.
Those identities require every inserted product to be exactly representable at the quire’s fixed-point quantum and every reachable partial sum and parallel reduction merge to stay within its signed capacity. A finite quire is not closed under unlimited real addition. Within the admitted domain, the identities make the final rounded result independent of the reduction tree for the same inserted terms. Posits concentrate fraction bits near magnitude and taper toward lower precision at extreme magnitudes. Natural units place characteristic quantities near that high-precision region, even though close-encounter forces can still span many orders of magnitude.
Casual numerical implementations often leave a second gap around time discretization, evaluating gravitational forces at isolated step instants and shrinking until plots look visually settled without bounding truncation error. As a body moves from to , it traverses every intermediate position along its continuous path across . Rigorous numerical analysis bounds point-sampled discretization through smoothness and remainder estimates, and validated Runge-Kutta methods pair stage evaluations directly with continuous-step trajectory enclosures (Sandretto and Chapoutot, 2016). We begin Phase 1 with the fixed-step symmetric Störmer-Verlet (leapfrog) map below as a clean point-sampled baseline for isolating arithmetic and reversal effects before adding validated step enclosures.
Two geometric properties of in exact real arithmetic do different jobs here (Rounding on Real Hardware). For the separable Hamiltonian above, fixed-step Verlet is symplectic: . Backward error analysis gives near-conservation of energy over exponentially long intervals under additional hypotheses, including an analytic Hamiltonian on the relevant domain, a sufficiently small fixed step, and a numerical orbit confined to a compact collision-free region (Hairer). Time-reversible step adaptation or alone does not establish symplecticity, so any adaptive or regularized scheme requires its own geometric analysis. Separately, time-symmetry under momentum negation gives the fixed-step map an exact inverse.
Propagating steps forward to , negating momenta via (ordinary value negation -p, preserving float<kg m / s>), propagating more steps with the same , and applying again returns to the initial state in exact arithmetic, without a checkpoint tape. Mission-control teams use a related time-symmetry maneuver during orbit determination when back-propagating state estimates across tracking passes to an earlier epoch, whereas here we close a forward-and-back loop on the discrete integrator itself. Because a rounded update can be non-injective and lack an inverse map, we define the discrete round-trip state and its dimensionless return residual directly.
That residual measures implementation irreversibility, isolating rounding only when force evaluation, reduction scheduling, events, and regime changes otherwise implement the same reversible map. An exact-arithmetic Verlet trajectory can still accumulate phase error while returning to its starting point, so complements forward-accuracy bounds without replacing them.
Discussion of long-horizon error growth also benefits from separating state-variable envelopes from trajectory-error divergence, rather than assuming universal exponential blowup across every initial condition (The Lyapunov Window). Along segments remaining in where , conserved energy bounds total kinetic energy and therefore speeds, giving position envelopes that grow at most linearly with time even when nearby trajectories separate rapidly inside that envelope. For trajectory error itself, established numerical analysis proves linear growth in time under suitable integrability and integrator hypotheses (Hairer), though preserving classical invariants alone does not supply those hypotheses. Conversely, chaotic hyperbolic dynamics have been proved in specific three-body regimes (Guardia et al.) without implying a uniform exponential rate for arbitrary initial data or for every step. Stepwise Grönwall-style estimates produce uniform geometric growth whenever a common amplification bound and local defect bound (covering truncation, force approximation, and rounding) are imposed on every step in the normalized phase-space norm, giving the recurrence below.
Over finite intervals where close-encounter stretching is empirically well modeled by , a dimensionless tolerance gives the heuristic prediction horizon below. Here is an observed growth rate with units of inverse time, is an effective perturbation in the normalized norm, and is a dimensionless prefactor. Changing the arithmetic does not change the continuous equations, though it can shift the numerical trajectory and its measured growth rate.
Halving the effective perturbation extends this modeled horizon by roughly units of physical time, or dynamical-time units. An extra arithmetic bit yields that gain only while it reduces the dominant local error, before truncation, force approximation, or initial-data uncertainty sets a floor. We measure the horizon against the convergence-checked reference trajectory rather than inferring it from conserved integrals.
Tracking barycentric momentum drift , angular momentum drift, and energy residual reveals integration, force-approximation, and rounding errors. Normalizing energy drift by suits this negative-energy cold start, while zero-energy trajectories require another reference scale. Yet flight-dynamics teams know the classic operational trap: along-track (in-track) phase drift. An integrator with slight period error can keep energy and momentum plots looking flat while placing a spacecraft kilometers ahead or behind in its orbital slot. Reference comparison , tape-free return residual , and invariant drift stay separate curves in the planned ThreeBody experiments. Whenever remains at or below across a run (where the mathematical infimum is ), a finite experiment reports only that no exceedance occurred over its observation window.
Using those conservation laws actively inside propagation offers a compelling Phase 2 direction beyond passive post-mortem plots, inspired by John Gustafson’s proposal to prune unit-in-the-last-place cells (uboxes) against the seven autonomous spatial invariants (, , and ). Making that idea rigorous separates a heuristic rounding filter from a certified enclosure. A local box around a stored coordinate captures representation granularity at a single step, whereas enclosing the true trajectory across multiple steps requires propagating accumulated state sets together with continuous ODE remainder bounds rather than resetting to a one-ULP neighborhood that could drop the true solution. Likewise, interval constraint tests discard provably impossible boxes, yet survival means a box has not been refuted rather than proving one point inside it satisfies all seven invariants simultaneously. Generically, where those constraints are independent, fixing , , and in -dimensional spatial phase space still leaves an -dimensional level set, or eight dimensions after also fixing center-of-mass position (and six in the -dimensional planar problem after fixing its four autonomous invariants and center-of-mass position), so substantial uncertainty can still spread along the conservation surface.
Collapsing surviving boxes to their centroid also relinquishes the set enclosure and need not preserve nonlinear invariants such as or (much as two distinct points on a circle average off the circle), requiring separate constrained correction and verification if a point restart is desired. The real experimental question for ThreeBody is whether running the same validated propagation and invariant-pruning procedure keeps certified enclosures usefully tight for longer at manageable cost, while varying pruning, quire accumulation, and bposit32 versus IEEE state width independently to measure whether posits improve certified set size, forward accuracy, or compute cost.
Once we have the foundational measurements and software tooling that demonstrate this in a 2D plane, the next steps include expanding the count, size, and placement of bodies and moving the simulation into three dimensions. That step will trigger its own round of follow-on work to keep live visualization smooth and responsive across dramatic scale changes, placing coordinated demand on GPU, NPU, and FPGA accelerator resources that we look forward to exploring, for this problem and for many others.
Physical Fidelity Without Stripping the Types
Stepping back from the equations, the engineering goal behind all of this machinery is straightforward. Teams building ground-control and mission-control software, from ephemeris propagation and orbit determination to maneuver planning and conjunction screening, should be able to keep physical laws, singularity boundaries, accumulator guarantees, and dimensional units attached to executable code through the hardest parts of the math. Stripping units down to raw double arrays at a Kustaanheimo-Stiefel transformation or hiding a Newtonian pole behind an ad hoc softening constant trades away the exact invariants that catch silent operational bugs.
ThreeBody gives us a concrete astrodynamics laboratory where every piece of that commitment has to hold together at once: unsoftened point-mass domains alongside FMM far-field error bounds, KS regularization and event-resolved contact for colliding trajectories, three working-arithmetic paths (including compensated binary64 and FPGA bposit32 quires) alongside a separately converged reference, and -dimensional unification across fractional powers. As each component moves from specification into running Clef and Composer code, its curves and diagnostics will have to stand on measured reference residuals.
Readers who remember our Breaking the P vs NP Mystique entry will recognize the same engineering posture in continuous framing. Neither discrete worst-case complexity nor continuous non-integrability goes away, yet treating either theorem as a license for fatalism squanders the structure real problems actually carry. Where discrete workloads gain traction by lowering local constraints and dataflow onto matching silicon, ThreeBody keeps domain boundaries, regularizable binary encounters, rational dimensions, and conservation laws intact so each regime targets the arithmetic and hardware built for it.
Three-body astrodynamics is a highly specialized test case, yet that reach holds practical lessons across a wide array of commercial and industrial domains. None of the compiler mechanisms stressed here stay locked inside spaceflight software. Once rational dimensions, range-checked denominators, and verified accumulator placement exist in the toolchain, every Clef program inherits them:
- Autonomous robotics, guidance, and sensor fusion: Inertial navigation and Kalman filtering combine coordinate-frame rotations with noise amplitude spectral densities such as and angle-random-walk coefficients in , keeping units intact across state estimators where frame and scaling bugs otherwise hide in untyped matrices.
- Quantitative finance, risk, and settlement: Multi-leg derivatives pricing, Brownian-model uncertainty proportional to , and parallel portfolio reductions face the same twin hazards ThreeBody isolates: non-associative rounding drift across millions of sums and unit mismatches across currencies, rates, and tenors.
- Energy grids, industrial control, and multiphysics digital twins: Power-system state estimation, battery electrochemistry (where semi-infinite diffusion gives Warburg impedance proportional to ), and coupled fluid-structure solvers mix stiff local events with bulk field calculations across heterogeneous processors.
- AI, quantum-adjacent simulation, and everyday software: Narrow-bitwidth neural and neuromorphic inference on NPUs and FPGAs depends on wide-accumulator discipline so dot products do not collapse into rounding noise, quantum circuit simulations lean on controlled phase precision, and everyday backend or embedded tooling gets zero-cost dimensional safety, supervised actor concurrency, and clean hardware targeting out of the same compiler.
Pushing against an unforgiving physical problem forces us to solve precision, typing, and hardware coordination cleanly in the Fidelity Framework. We consider this to be the honest work of advanced design made practical. It stands in contrast to the old approach of simply leaving application developers to patch around these concerns by hand. We are excited to see ThreeBody take shape, both for what its trajectories will measure directly and for the everyday engineering confidence that same foundation brings to wide variety of systems forged at the software/hardware boundary.