{"capsule":{"id":"46fe68ba0b3218784ddec6a6647bf96d","name":"fx_sqrt_q16","domain":"fixed-point","source_code":"pub fn fx_sqrt_q16(value: i64) -> i64 {\n    // sqrt of a Q16.16 raw value, staying in Q16.16: sqrt(v * 2^16) * 2^16.\n    // Guarded so any i64 lands in range: negatives and the shift-overflow\n    // headroom both clamp, and the result is exact integer isqrt -- no float.\n    const FRAC: u32 = 16;\n    if value <= 0 {\n        return 0;\n    }\n    let headroom = i64::MAX >> FRAC;\n    let raw = if value > headroom { headroom } else { value };\n    (raw << FRAC).isqrt()\n}","inputs":[{"name":"value","pin_type":"i64","direction":"input"}],"output":{"name":"out","pin_type":"i64","direction":"output"},"signature_key":"(i64)->i64","c64_report":{"code_bytes":468,"ram_budget_ratio":{"num":117,"den":16384},"fits_fast_page":true,"ast_node_count":27,"zero_unsafe":true,"zero_external_crates":true,"zero_floats":true},"marine_salience":{"peak_count":10,"period_jitter":{"num":0,"den":1},"amplitude_jitter":{"num":497,"den":1755},"combined_jitter":{"num":497,"den":3510},"salience_score":{"num":30130,"den":351},"salience_trit":"Pos","wave_signature":{"frequencies_hz":[475,864,1296,2073,3024,2851,3024,4147],"phases_mrad":[1342,0,0,6041,2443,5799,0,429],"amplitudes":[85,8,8,55,51,42,8,29],"interference_hash":[79,149,225,121,145,97,14,224,110,222,40,215,193,165,221,211,185,241,72,8,3,27,245,102,140,205,250,247,121,101,144,14]}},"author_aye":"aye::Peter+Omni(0+1)::aarch64","author_resonance_hz":432,"published_epoch_ns":1794865800360581012,"compiled_text_bytes":478,"asm_instruction_count":154,"asm_preview":"fx_sqrt_q16:\n    test    rdi, rdi\n    jle    .LBB7_1\n    movabs    r8, 140737488355327\n    cmp    rdi, r8\n    cmovb    r8, rdi\n    shl    r8, 16\n    cmp    rdi, 65536\n    jae    .LBB7_3\n    bsr    esi, r8d\n    xor    esi, 31\n    mov    ecx, esi\n    and    cl, 30\n    shl    r8d, cl\n    mov    eax, r8d\n    shr    eax, 24\n    lea    rdx, [rip + .Lanon.a270e05f789020653a98a620bea8a67e.3]\n    movzx    ecx, byte ptr [rdx + 2*rax]\n    movzx    edx, byte ptr [rdx + 2*rax + 1]\n    mov    edi, ecx\n    add    edi, ecx\n    shl    edx, 4\n    mov    eax, r8d\n    shr    eax, 20\n    and    eax, 15\n    or    eax, edx\n    xor    edx, edx\n    div    di\n    mov    edi, r8d\n    shr    edi, 16\n    xor    r9d, r9d\n    shl    cl, 4\n    movzx    ecx, cl\n    add    ecx, eax\n    shl    edx, 4\n    and    edi, 15\n    or    edi, edx\n    imul    eax, eax\n    sub    di, ax\n    lea    eax, [rcx + rcx - 1]\n    cmovae    eax, r9d\n    sbb    cx, 0\n    add    eax, edi\n    movzx    edi, cx\n    add    edi, edi\n    movzx    eax, ax\n    shl    eax, 8\n    xor    edx, edx\n    div    edi\n    shl    ecx, 8\n    movzx    edi, cx\n    add    edi, eax\n    mov    eax, edi\n    mul    edi\n    seto    cl\n    cmp    eax, r8d\n    seta    al\n    or    al, cl\n    movzx    eax, al\n    sub    edi, eax\n    shr    esi\n    mov    ecx, esi\n    shr    edi, cl\n    mov    rax, rdi\n    ret\n.LBB7_1:\n    xor    edi, edi\n    mov    rax, rdi\n    ret\n.LBB7_3:\n    bsr    rsi, r8\n    xor    rsi, 63\n    mov    ecx, esi\n    and    cl, 62\n    shl    r8, cl\n    mov    rax, r8\n    shr    rax, 56\n    lea    rcx, [rip + .Lanon.a270e05f789020653a98a620bea8a67e.3]\n    movzx    edi, byte ptr [rcx + 2*rax]\n    movzx    ecx, byte ptr [rcx + 2*rax + 1]\n    mov    r9d, edi\n    add    r9d, edi\n    shl    ecx, 4\n    mov    rax, r8\n    shr    rax, 52\n    and    eax, 15\n    or    eax, ecx\n    xor    edx, edx\n    div    r9w\n    mov    r9, r8\n    shr    r9, 48\n    xor    ecx, ecx\n    shl    dil, 4\n    movzx    edi, dil\n    add    edi, eax\n    shl    edx, 4\n    and    r9d, 15\n    or    r9d, edx\n    imul    eax, eax\n    sub    r9w, ax\n    lea    eax, [rdi + rdi - 1]\n    cmovae    eax, ecx\n    sbb    di, 0\n    add    eax, r9d\n    movzx    r9d, di\n    add    r9d, r9d\n    movzx    edx, ax\n    shl    edx, 8\n    mov    rax, r8\n    shr    rax, 40\n    movzx    eax, al\n    or    eax, edx\n    xor    edx, edx\n    div    r9d\n    mov    r9, r8\n    shr    r9, 32\n    shl    edi, 8\n    movzx    edi, di\n    add    edi, eax\n    shl    edx, 8\n    movzx    r9d, r9b\n    or    r9d, edx\n    imul    eax, eax\n    sub    r9d, eax\n    lea    eax, [rdi + rdi - 1]\n    cmovae    eax, ecx\n    lea    edx, [r9 + rax]\n    sbb    edi, 0\n    lea    rcx, [rdi + rdi]\n    shl    rdx, 16\n    mov    eax, r8d\n    shr    eax, 16\n    or    rax, rdx\n    or    rdx, rcx\n    shr    rdx, 32\n    test    dx, dx\n    je    .LBB7_4\n    xor    edx, edx\n    div    rcx\n    jmp    .LBB7_6\n.LBB7_4:\n    xor    edx, edx\n    div    ecx\n.LBB7_6:\n    shl    edi, 16\n    add    rdi, rax\n    mov    rax, rdi\n    mul    rdi\n    seto    cl\n    cmp    rax, r8\n    seta    al\n    or    al, cl\n    movzx    eax, al\n    sub    rdi, rax\n    shr    esi\n    mov    ecx, esi\n    shr    rdi, cl\n    mov    rax, rdi\n    ret","output_digest_blake3":"5f315382a2ed93a5d8582fc35e9bd144"},"efficiency":{"capsule_id":"46fe68ba0b3218784ddec6a6647bf96d","vote_count":1,"total_historical_votes":1,"net_trit_score":1,"net_trit_balanced":"+","consensus_trit":"Pos","speed_ops_per_us":{"num":100000000,"den":404479},"ns_per_op":{"num":404479,"den":100000},"cycles_per_op":{"num":6471,"den":500},"c64_memory_ratio":{"num":239,"den":32768},"timing_salience":{"num":2440217937146508199,"den":24444733903786890},"efficiency_index":{"num":8726899399089246507,"den":23573354541468100}},"ns_per_op_pq":"404479/100000","speed_ops_per_us_pq":"100000000/404479","cycles_per_op_pq":"6471/500","marine_salience_pq":"30130/351","vote_trits":"+","equivalence_class":"(i64)->i64::5f315382a2ed"}