+ ei.futilityMargin = Value(0); // Manually initialize futilityMargin
+
+ // Evaluate the position statically
+ if (isCheck)
+ staticValue = quick_evaluate(pos);
+ else if (tte && (tte->type() & VALUE_TYPE_EVAL))
+ staticValue = value_from_tt(tte->value(), ply);
+ else
+ staticValue = evaluate(pos, ei, threadID);
+
+ // Calculate depth dependant futility pruning parameters
+ const int FutilityMoveCountMargin = 3 + (1 << (3 * int(depth) / 8));
+ const int FutilityValueMargin = 112 * bitScanReverse32(int(depth) * int(depth) / 2);
+
+ // Enhance score accuracy with TT value if possible
+ ss[ply].eval = staticValue;
+ futilityValue = staticValue + FutilityValueMargin;
+ staticValue = refine_eval(tte, staticValue, ply);