From: Chris Caino Date: Tue, 22 Oct 2013 21:05:15 +0000 (+0200) Subject: Simplify futility margins formula X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=fbfce2132aff3e8528086fb14ae3fb8ef47c212e Simplify futility margins formula New formula mathces the old formula until d = 45 Test code: int main() { for(int d=1; d<=45; d++) { int a = int(log(double(d * d) / 2) / log(2.0) + 1.001); int b = int(2.9 * log(double(d))); if (a != b) std::cout << d << std::endl; } return 0; } bench: 8455956 --- diff --git a/src/search.cpp b/src/search.cpp index 36a89d83..442f7f5d 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -150,7 +150,7 @@ void Search::init() { // Init futility margins array for (d = 1; d < 16; ++d) for (mc = 0; mc < 64; ++mc) - FutilityMargins[d][mc] = Value(112 * int(log(double(d * d) / 2) / log(2.0) + 1.001) - 8 * mc + 45); + FutilityMargins[d][mc] = Value(112 * int(2.9 * log(double(d))) - 8 * mc + 45); // Init futility move count array for (d = 0; d < 32; ++d)