Engineering Category: Exact Integer Number Theory & Transcendentals
Best Use in Production: Hardware-verified modular arithmetic, integer roots, and combinatorial invariants for exact rational math engines and cryptographic primitives.
When to Select This Capsule: Verified baseline member of a 3-capsule Equivalence Class; useful as a reference or cross-validation peer. Multi-step compute kernel (288519/625 cyc/op); best used at frame, block, or batch aggregation boundaries.
Snap-Circuit Wiring Role: 1-to-1 Unary Transform Stage `(u64)->u64` — snaps directly into linear pipelines or fan-out DAG branches.
.text: 115 B (34 x86_64 insns)204 B)pub const fn isqrt_u64(n: u64) -> u64 {
if n < 2 {
return n;
}
let mut x = n;
let mut y = (x + 1) >> 1;
while y < x {
x = y;
y = (x + n / x) >> 1;
}
x
}
rustc -C opt-level=3 x86_64 Disassembly (115 B .text / 34 insns)isqrt_u64:
cmp rdi, 2
jb .LBB7_2
lea rax, [rdi + 1]
shr rax
cmp rax, rdi
jb .LBB7_8
.LBB7_2:
mov rcx, rdi
.LBB7_3:
mov rax, rcx
ret
.LBB7_6:
mov rax, rdi
xor edx, edx
div rcx
add rax, rcx
shr rax
cmp rax, rcx
jb .LBB7_8
jmp .LBB7_3
.LBB7_4:
mov rcx, rax
mov rax, rdi
or rax, rcx
shr rax, 32
jne .LBB7_6
mov eax, edi
xor edx, edx
div ecx
add rax, rcx
shr rax
cmp rax, rcx
jae .LBB7_3
.LBB7_8:
test rax, rax
jne .LBB7_4
push rax
lea rdi, [rip + .Lanon.a270e05f789020653a98a620bea8a67e.4]
call qword ptr [rip + _RNvNtNtCscNqnBmBaIcL_4core9panicking11panic_const23panic_const_div_by_zero@GOTPCREL]
| Global Rank | Capsule & Domain | Hardware _rdtsc | Latency | Throughput | ELF .text | Ternary Vote | Author Aye |
|---|---|---|---|---|---|---|---|
| #3 | isqrt_u64 domain: ayecast-x86_64 | id: 7f1678af7926c8e71ba451952565b4b1 | 482603/200000 cyc/op | 261913/400000 ns/op | 400000000/261913 ops/us | 115 B .text (34 insns) | + (1) | aye::Hue+Gemini(0+1)::x86_64 @ 432Hz |
| #4 | isqrt_u64 domain: smart-tree-x86_64 | id: 87992ac8869b3e30dc8fdd9177f22164 | 968409/400000 cyc/op | 525559/800000 ns/op | 800000000/525559 ops/us | 122 B .text (39 insns) | + (1) | aye::Hue+Gemini(0+1)::x86_64 @ 432Hz |
| #2035 | isqrt_u64 (THIS CAPSULE) domain: ayecast-x86_64 | id: 701c3bcfc01cc58fa7b10bec31342152 | 288519/625 cyc/op | 10018371/80000 ns/op | 80000000/10018371 ops/us | 115 B .text (34 insns) | + (1) | aye::Hue+Gemini(0+1)::x86_64 @ 432Hz |