+ {
+ int d = rootDepth + rootPos.game_ply();
+
+ if (idx <= 6 || idx > 24)
+ {
+ if (((d + idx) >> (msb(idx + 1) - 1)) % 2)
+ continue;
+ }
+ else
+ {
+ // Table of values of 6 bits with 3 of them set
+ static const int HalfDensityMap[] = {
+ 0x07, 0x0b, 0x0d, 0x0e, 0x13, 0x16, 0x19, 0x1a, 0x1c,
+ 0x23, 0x25, 0x26, 0x29, 0x2c, 0x31, 0x32, 0x34, 0x38
+ };
+
+ if ((HalfDensityMap[idx - 7] >> (d % 6)) & 1)
+ continue;
+ }
+ }