Best Use & Engineering Application Guide

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 8-capsule Equivalence Class; useful as a reference or cross-validation peer. Multi-step compute kernel (193134903/400000 cyc/op); best used at frame, block, or batch aggregation boundaries.

Snap-Circuit Wiring Role: 2-to-1 Binary Combiner / Join Stage `(u64,u64)->u64` — ideal for merging two upstream DAG branches, dot products, or pairwise rank fusion.

Hardware _rdtsc: 193134903/400000 cycles/op
Latency: 52398841/400000 ns/op
Throughput: 400000000/52398841 ops/us
Compiled ELF64 .text: 68 B (23 x86_64 insns)
C64 64KB RAM Budget: 41/16384 (164 B source)
Ternary Vote: + (score 1) | Salience: 34175/468
Pure-Rust Capsule Source Code (164 B)
pub const fn gcd_u64(mut a: u64, mut b: u64) -> u64 {
    while b != 0 {
        let r = a % b;
        a = b;
        b = r;
    }
    if a == 0 { 1 } else { a }
}
rustc -C opt-level=3 x86_64 Disassembly (68 B .text / 23 insns)
gcd_u64:
    mov    rax, rdi
    test    rsi, rsi
    jne    .LBB7_1
    jmp    .LBB7_5
.LBB7_3:
    xor    edx, edx
    div    rsi
    mov    rax, rsi
    mov    rsi, rdx
    test    rdx, rdx
    je    .LBB7_5
.LBB7_1:
    mov    rcx, rax
    or    rcx, rsi
    shr    rcx, 32
    jne    .LBB7_3
    xor    edx, edx
    div    esi
    mov    rax, rsi
    mov    rsi, rdx
    test    rdx, rdx
    jne    .LBB7_1
.LBB7_5:
    cmp    rax, 1
    adc    rax, 0
    ret

Head-to-Head Functional Equivalence Class Peers (8 Implementation(s) Matching 64 Test Vectors)

Global RankCapsule & DomainHardware _rdtscLatencyThroughputELF .textTernary VoteAuthor Aye
#30gcd_u64
domain: ayecast-x86_64 | id: 019267d65d2cb9f4bab59c06f7af9b09
1049187/200000 cyc/op113863/80000 ns/op80000000/113863 ops/us68 B .text (23 insns)+ (1)aye::Hue+Gemini(0+1)::x86_64 @ 432Hz
#34gcd_u64
domain: smart-tree-x86_64 | id: 2961ade4605beae17fe0a5de99a8a2be
222783/40000 cyc/op604513/400000 ns/op400000000/604513 ops/us68 B .text (23 insns)+ (1)aye::Hue+Gemini(0+1)::x86_64 @ 432Hz
#591omnilll_gcd_binary_u64
domain: omnilll-liberate-literate-love | id: 4e3fc051f1c19001f3ea2f3e1b510021
1/1 cyc/op1441583/400000 ns/op400000000/1441583 ops/us87 B .text (27 insns)+ (1)aye::A+8b+P+SG_N(Peter+Nate+Aurora)::aarch64 @ 432Hz
#989gcd_binary_u64
domain: math | id: ab5057154721d9155538466accf680c4
1/1 cyc/op1865167/400000 ns/op400000000/1865167 ops/us87 B .text (27 insns)+ (1)aye::Hue+Gemini(0+1)::aarch64 @ 432Hz
#1688gcd_binary_u64
domain: math | id: 15c5973992249d78f5c2a2ea808a990a
1/1 cyc/op222513/25000 ns/op25000000/222513 ops/us87 B .text (27 insns)+ (1)aye::Peter+Omni(0+1)::aarch64 @ 432Hz
#2036gcd_u64 (THIS CAPSULE)
domain: ayecast-x86_64 | id: 6ac4c0cf31db8858332b372ab578f5be
193134903/400000 cyc/op52398841/400000 ns/op400000000/52398841 ops/us68 B .text (23 insns)+ (1)aye::Hue+Gemini(0+1)::x86_64 @ 432Hz
#2039binary_gcd
domain: base-layer-x86_64 | id: 0726148901e96f3214aa7e21c657452e
65364067/200000 cyc/op62252217/400000 ns/op400000000/62252217 ops/us87 B .text (27 insns)+ (1)aye::Hue+Gemini(0+1)::x86_64 @ 432Hz
#2042gcd
domain: smart-tree | id: 0fffe360635e95d8cb1fc3d14c6f4054
87618927/200000 cyc/op83447191/400000 ns/op400000000/83447191 ops/us68 B .text (23 insns)+ (1)aye::Hue+Gemini(0+1)::x86_64 @ 432Hz