// Null move search not allowed, try razoring
else if ( !value_is_mate(beta)
&& approximateEval < beta - RazorMargin
- && depth < RazorDepth)
+ && depth < RazorDepth
+ && depth > OnePly
+ && ttMove == MOVE_NONE
+ && !pos.has_pawn_on_7th(pos.side_to_move()))
{
Value v = qsearch(pos, ss, beta-1, beta, Depth(0), ply, threadID);
- if (v < beta - RazorMargin / 2)
+ if (v < beta - RazorMargin / 2 - int(depth - OnePly) * RazorMargin / 8)
return v;
}
continue;
// Value based pruning
- if (depth < 6 * OnePly && approximateEval < beta)
+ if (depth < 7 * OnePly && approximateEval < beta)
{
if (futilityValue == VALUE_NONE)
futilityValue = evaluate(pos, ei, threadID)
- + (depth < 2 * OnePly ? FutilityMargin1
- : FutilityMargin2 + (depth - 2*OnePly) * 32);
+ + (depth < 2 * OnePly ? FutilityMargin1 :
+ + (depth < 6 * OnePly ? FutilityMargin2 + (depth - 2*OnePly) * 32
+ : FutilityMargin2 + (depth - 2*OnePly) * 64));
+
if (futilityValue < beta)
{
if (futilityValue > bestValue)