]> git.sesse.net Git - stockfish/commitdiff
Properly handle odd depths in razor formula
authorMarco Costalba <mcostalba@gmail.com>
Sun, 28 Dec 2008 18:38:44 +0000 (19:38 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 28 Dec 2008 18:38:44 +0000 (19:38 +0100)
A little bit more aggressive, but should be more
in line with the depths logic.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp

index 39dcf9768157d4276ccc97fbe50a80bafc2b1c73..15ebbad0653e6add1f5fa9e4fa99df4ae92ee963 100644 (file)
@@ -1242,14 +1242,14 @@ namespace {
     else if (   !value_is_mate(beta)
              && approximateEval < beta - RazorMargin
              && depth < RazorDepth
-             && (RazorAtDepthOne || depth > OnePly)
+             && (RazorAtDepthOne || depth >= 2*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 - RazorMargin / 4)
-            || (depth <= 2*OnePly && v < beta - RazorMargin)
-            || (depth <=   OnePly && v < beta - RazorMargin / 2))
+            || (depth < 3*OnePly && v < beta - RazorMargin)
+            || (depth < 2*OnePly && v < beta - RazorMargin / 2))
             return v;
     }