]> git.sesse.net Git - stockfish/blobdiff - src/evaluate.cpp
Use predicted depth for history pruning
[stockfish] / src / evaluate.cpp
index 489422fc96f163770aa71791f987baa6d4b0a8a4..d3ddfd510bad2e51a92ce991386bbcb135de2738 100644 (file)
@@ -703,10 +703,10 @@ namespace {
 
     // ...count safe + (behind & safe) with a single popcount
     int bonus = popcount((Us == WHITE ? safe << 32 : safe >> 32) | (behind & safe));
-    int weight =  pos.count<KNIGHT>(Us) + pos.count<BISHOP>(Us)
-                + pos.count<KNIGHT>(Them) + pos.count<BISHOP>(Them);
+    bonus = std::min(16, bonus);
+    int weight = pos.count<ALL_PIECES>(Us);
 
-    return make_score(bonus * weight * weight * 2 / 11, 0);
+    return make_score(bonus * weight * weight / 22, 0);
   }