These are not abstractions layered over reality.
They ARE reality. The universe does not "use" sine to make waves — waves are what sine IS.
Lithos does not "implement" these operations. It is the substrate where they run.
Every primitive, what it does in physics, where it lives in Universe today, where it could go, and what Lithos does to it.
| Symbol | Name | Physics | Universe Today | Universe Potential | Lithos Perf |
|---|---|---|---|---|---|
| Oscillation — the heartbeat | |||||
| ∼ | sine | Standing waves, electron orbitals, all oscillation. The hydrogen atom IS a sine resonance — the electron's wavefunction must fit integer wavelengths around the nucleus. Every quantum state is a harmonic of sine. | Terrain hills, wind sway, orbits, noise hash, breathing, galaxy rotation, god rays, firefly pulses, audio synthesis, mortar lines, star twinkle, camera bob | Foundation of everything — already the most-called function. 16x improvement propagates through every layer above it: hash → vnoise → fbm → terrain → sceneSDF | 16x vs libm |
| ˜ | cosine | Phase-shifted sine. Interference patterns, crystallography, rotation matrices. sin²+cos²=1 defines the unit circle — the geometry of all rotation. | Camera forward vector, orbital position, wind direction, spiral arm geometry, tree twist, bat wing phase | Crystal structures, diffraction patterns, wave interference visualization, Bragg scattering in mineral epochs | 17x vs libm |
| Growth & Decay — the arrow of time | |||||
| ex | exponential | Growth and decay. Radioactive decay, population growth, compound interest, thermodynamic equilibrium. eix = cos(x) + i·sin(x) — Euler's formula unifying all three. | Fog falloff (exp(-d²)), atmospheric absorption, bloom/glow, Gaussian blur, softmax attention (inference) | Stellar evolution curves (luminosity = L₀·e-t/τ), Boltzmann distribution for gas simulation, chemical reaction rates, entropy visualization | Vectorized |
| ln | natural log | Entropy, information theory (Shannon entropy = -Σ p·ln(p)), thermodynamic arrow of time, Boltzmann's S = k·ln(W), decibels, acoustic scaling. | Star magnitude scale, logarithmic depth buffer, information-theoretic coloring in sdf_fields | Entropy visualization in heat-death epoch, information density maps, acoustic modeling, logarithmic spiral arms (exact) | Vectorized |
| Distance & Space — the fabric | |||||
| √ | square root | Distance. length(v) = √(v·v). Every spatial relationship in physics. Inverse-square laws (gravity, light). Schrödinger normalization. Pythagorean theorem. | SDF distance: length(p-center)-r, normal calculation, fog distance, camera-to-object distance, light attenuation | Gravity simulation (inverse-square), exact light falloff, wave amplitude decay, orbital mechanics | Hardware FSQRT |
| &frac1x; | reciprocal | 1/x. Newton's law of gravitation (1/r²), Coulomb's law, normalization (1/length). The fundamental form of field falloff. | RMSNorm (1/√variance), normalize vectors, perspective division | Gravitational lensing (exact 1/r² potential), inverse-square light, atmospheric scattering (Rayleigh 1/λ&sup4;) | FRSQRTE+Newton |
| Projection & Tensor — the interactions | |||||
| · | dot product | Projection. F·d = work. cos(θ) = a·b/|a||b|. The fundamental operation of physics: projecting one quantity onto another. Measurement itself. | Diffuse lighting (N·L), Fresnel (N·V), noise hash (dot(p,k)), camera facing, frustum culling | Ray-object intersection, force computation, energy calculation, attention scores (Q·K in transformer) | 11x vs GCC |
| ⊗ | outer product | Tensor product. Quantum entanglement (|ψ〉⊗|φ〉). Stress tensor, moment of inertia, metric tensor in general relativity. The operation that builds higher-dimensional objects from lower-dimensional ones. | Outer product in matmul for inference | Quantum visualization, stress/strain fields, gravitational field tensor, fluid dynamics (velocity gradient tensor) | 16-reg prefetch |
| Accumulation — the conservation laws | |||||
| Σ | summation | Integration. Conservation laws: energy, momentum, charge. Gauss's law, path integrals, partition functions. The universe conserves by summing. | FBM (sum of octaves), color accumulation, ambient occlusion (sum of samples), RMSNorm (sum of squares), volumetric glow accumulation | Energy conservation in physics sim, Feynman path integrals (cosmological), thermodynamic partition function | Shuffle-tree |
| Selection — the phase transitions | |||||
| ▵ | maximum | Selection, survival of the fittest, thermodynamic equilibrium (maximum entropy), phase transitions. Nature selects the dominant mode. | SDF subtraction: max(a,-b), argmax in sampling, LOD selection, height ceiling, clamp | Natural selection simulation, phase transition visualization, critical phenomena, Bose-Einstein condensation threshold | Parallel |
| ∇ | minimum | Optimization. Principle of least action (Lagrangian mechanics), geodesics (shortest path in curved spacetime), Fermat's principle (light takes the shortest path). Nature minimizes. | SDF union: min(terrain, trees), smooth minimum (smin), march step minimum, depth test | Geodesic paths through cosmos, least-action trajectories, light bending near massive objects, Lagrangian mechanics | Parallel |
| Arithmetic — the four forces | |||||
| × | multiply | Scaling, coupling, amplification. Every force law is a product (F=ma, F=kx, F=qE). Wave amplitude modulation. The operation that connects distinct physical quantities. | Color mixing, normal scaling, wind amplitude, time scaling, shader parameter adjustment, FBM octave weighting | Amplitude modulation, coupling constants, force computation, interaction terms in field equations | FMLA fusion |
| + | add | Superposition. THE principle of quantum mechanics. Waves add. Fields add. Forces add. Linearity is the default state of nature. | Residual connections (x + f(x)), color addition, position update (p + v·dt), fog blending, FBM octave stacking | Wave interference patterns, quantum superposition visualization, field addition, neural residual streams | FMLA fusion |
| − | subtract | Difference, gradient, change. Derivative = limit of differences. Temperature difference drives heat flow. Potential difference drives current. | SDF: length(p-center), normal computation (finite difference), residual (x - mean), ray advance (ro + rd*t) | Gradient fields, temperature gradients, chemical potential differences, electromotive force | Post-inc |
| / | divide | Ratio, normalization, proportion. The fundamental operation of measurement: comparing one quantity to another. Dimensionless numbers define regimes. | RMSNorm (x/rms), perspective divide, UV normalization, aspect ratio correction | Scale-free analysis, dimensionless numbers (Reynolds, Mach, Rayleigh), renormalization group | UDIV+MSUB |
| Memory — observation and recording | |||||
| → | load | Observation. Reading the state of the world. In quantum mechanics, measurement collapses the wavefunction. In thermodynamics, observation requires energy. | Texture read, buffer load, weight load (inference), heightmap lookup, KV cache read | Measurement-induced state change (quantum sim), sensor reading, memory access patterns | LDP pair |
| ← | store | Recording. Writing state back to the world. Memory, history, irreversibility. The second law of thermodynamics: you can read without cost, but writing is irreversible. | Framebuffer write, KV cache write, state persistence, render target output | State recording, history accumulation, irreversible computation, entropy production | STP pair |
Five constants. One equation. The deepest sentence in mathematics.
In Lithos terms: the ex primitive, the ∼ primitive, and the ˜ primitive are the same primitive viewed from three angles. Accelerating one accelerates the other two, because they are the same mathematical object rotating through the complex plane.
How a single oscillation becomes everything. Sine does not describe these phenomena — it is these phenomena.
∼ → standing wave resonancecosmos_earth.mjs renders this now.∼. The _make_element_ambient.mjs audio synthesizer knows this.Where each primitive is underutilized and what to do about it. Concrete implementation targets.
| Primitive | Current Use | Underutilized Potential | Implementation Plan |
|---|---|---|---|
| ex | Fog, glow, Gaussian blur | Stellar evolution curves, Boltzmann gas, chemical kinetics, radioactive decay chains | Add stellar lifecycle rendering in cosmos: luminosity = L₀·e-t/τ. Main sequence stars brighten exponentially over billions of years. Red giant expansion follows et. White dwarf cooling follows e-t. Each epoch shift IS an exponential. |
| ln | Magnitude scale, depth buffer | Shannon entropy visualization, information density, acoustic modeling | Color scenes by information content: H = -Σ p·ln(p). High-entropy regions (gas, turbulence) glow warm. Low-entropy regions (crystals, order) glow cool. The cosmos becomes a map of information, not just light. Also: exact logarithmic spiral arms via r = a·ebθ → θ = ln(r/a)/b. |
| ⊗ | Inference matmul only | Gravitational field visualization, stress tensors, metric tensor | Render gravitational field as tensor field around massive bodies in cosmos. The metric tensor gμν near a black hole is an outer product of basis vectors. Visualize spacetime curvature by showing how the tensor field deforms a grid of test particles. |
| &frac1x; | Normalize vectors, perspective | Exact gravitational lensing (1/r² potential), Rayleigh scattering | Replace approximate lensing in cosmos with exact inverse-square. Current gravitational lensing uses a simplification — true lensing requires integrating 1/r² along the photon path. Also: Rayleigh scattering (sky color) is 1/λ&sup4; — reciprocal to the fourth power gives physically correct sunset colors. |
| Σ | FBM, AO, volumetric glow | Path integrals, energy conservation, partition functions | Accumulate energy along photon paths for physically-correct rendering. Current glow is ad-hoc — true volumetric scattering sums contributions along the ray: I = Σ σ(s)·L(s)·e-τ(s)·Δs. Also: energy conservation constraint — total light emitted + absorbed + scattered = constant per frame. |
| ∼ / ˜ | Everything | Still underutilized at batch level | Lithos NEON batch: 4-wide sin/cos evaluation for terrain/noise. Currently every sin call is scalar. Batching terrain height evaluation — computing 4 heights simultaneously — would give 4x throughput on the single most expensive call chain (hash → vnoise → fbm → terrainH). |
| · | Lighting, hash, facing | Attention scores, force computation | Q·K attention in on-device inference uses dot product as its core op. Currently Lithos dot is 11x faster than GCC. Fusing dot with scale (Q·K/√d) into a single instruction saves one divide per attention score. Also: gravitational force F = -G·m₁·m₂·(r₁·r₂)/|r|³ is a dot product in disguise. |
| ▵ / ∇ | SDF union/subtraction | Phase transitions, geodesics | Geodesic pathfinding through cosmos. Light follows the minimum-time path (Fermat). In curved spacetime near a star, min() over candidate paths gives the geodesic. Visualize gravitational lensing as a min-path computation, not a post-process warp. |
| √ | SDF distance, normals, fog | Gravity simulation, physical light | Physical light falloff: intensity ~ 1/r² = 1/(d·d) where d = √(dx²+dy²+dz²). Current lighting uses approximate falloff. Hardware FSQRT is already fast — use it for exact inverse-square light in home scenes. The difference is visible: physical light makes nearby objects much brighter and distant objects much dimmer. |
| → / ← | Framebuffer, KV cache | Temporal state, measurement | Temporal accumulation buffer. Store previous frame's SDF evaluations and reuse when camera moves slowly. Load previous terrain heights instead of recomputing FBM. The LDP/STP pair instructions are the fastest memory ops on ARM64 — a terrain cache hit is ~2 cycles vs ~80 cycles for FBM recomputation. |
The imaginary unit is not imaginary. It is rotation. And rotation, iterated, generates the most complex structures in mathematics.
where z and c are complex numbers: a + bi. Each iteration squares and adds. Squaring a complex number doubles its angle and squares its magnitude. This is why multiplication by i is rotation — i² = −1 means two 90° rotations equal reflection.
The Mandelbrot set is the boundary between orbits that escape and orbits that stay bounded. That boundary has infinite fractal detail because rotation + scaling at every step creates self-similar folding at every scale.
z → z² + c, c varies, z starts at 0. The set is the catalog of all possible Julia sets — each point in the Mandelbrot set IS a Julia set. mandelbrot.html renders this in Universe now.
z → z² + c, z varies, c is fixed. Each choice of c gives a different fractal. Connected Julia sets correspond to points inside the Mandelbrot set. Disconnected Julia sets (Fatou dust) correspond to points outside.
Iterated Function Systems: repeated rotation + scaling. ifsBranch in stdlib.mjs applies domain folding 8 times — each fold is multiplication by eiθ. The tree IS iterated complex rotation.
Mandelbrot, Julia, and IFS trees are all the same operation: iterate a complex function. i provides the rotation that creates folding. Without i, iteration would just scale — no structure, no fractals, no trees.
The rotation that i provides — multiplication by i = 90° rotation in the complex plane — is why fractals have structure. Pure scaling (real multiplication) produces exponential growth or decay. Add rotation (complex multiplication) and you get folding, spiraling, self-similar structure at every scale. This is why eiθ = cosθ + i·sinθ matters: it unifies scaling (e) with rotation (i, sin, cos) into a single operation.
The Mandelbrot renderer uses 256 iterations of z → z² + c per pixel. The ifsBranch function in stdlib.mjs uses 8 iterations of fold-rotate-scale per fragment. Both are iterated complex rotation — the same atom (i) expressing itself through different iteration counts and different initial conditions. The fractal trees in the home scenes and the Mandelbrot deep-zoom are the same mathematics.
24 primitives generate a cosmos.
Not because they are powerful abstractions.
Because they are the operations reality actually performs.
Sine does not model waves. Sine IS waves.
Exponential does not model decay. Exponential IS decay.
Dot product does not model projection. Dot product IS projection.
Lithos does not simulate physics. It runs the same math physics runs.