- ss[sp->ply].reduction = OnePly;
- value = -search(pos, ss, -sp->alpha, newDepth - OnePly, sp->ply+1, true, threadID);
+ double red = ln(moveCount) * ln(sp->depth / 2) / 3.0;
+ if (red >= 1.0)
+ {
+ ss[sp->ply].reduction = Depth(floor(red * int(OnePly)));
+ value = -search(pos, ss, -sp->alpha, newDepth-ss[sp->ply].reduction, sp->ply+1, true, threadID);
+ }
+ else
+ value = sp->alpha + 1; // Just to trigger next condition