X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=89636f23575398840559967029541bf94ad3d736;hp=0619db3a12a2420a2ef85864ab84e709c614a158;hb=50287a55d3b07623120d938a4159d051e32d852d;hpb=12e79be91039796299187ba1b2f1559552642ea4;ds=sidebyside diff --git a/src/search.cpp b/src/search.cpp index 0619db3a..89636f23 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -153,7 +153,8 @@ void Search::init() { for (int d = 1; d < 64; ++d) for (int mc = 1; mc < 64; ++mc) { - double r = log(d) * log(mc) / 1.95; + double slope = d > 2 ? 0.88 * d + 0.36 : d; + double r = log(slope) * log(mc) / 1.95; Reductions[NonPV][imp][d][mc] = int(std::round(r)); Reductions[PV][imp][d][mc] = std::max(Reductions[NonPV][imp][d][mc] - 1, 0); @@ -985,11 +986,9 @@ moves_loop: // When in check, search starts from here if (captureOrPromotion) // (~5 Elo) { - // Increase reduction by comparing opponent's stat score - if ((ss-1)->statScore >= 0) - r += ONE_PLY; - - r -= r ? ONE_PLY : DEPTH_ZERO; + // Decrease reduction by comparing opponent's stat score + if ((ss-1)->statScore < 0) + r -= ONE_PLY; } else { @@ -1030,10 +1029,10 @@ moves_loop: // When in check, search starts from here r += ONE_PLY; // Decrease/increase reduction for moves with a good/bad history (~30 Elo) - r = std::max(DEPTH_ZERO, (r / ONE_PLY - ss->statScore / 20000) * ONE_PLY); + r -= ss->statScore / 20000 * ONE_PLY; } - Depth d = std::max(newDepth - r, ONE_PLY); + Depth d = std::max(newDepth - std::max(r, DEPTH_ZERO), ONE_PLY); value = -search(pos, ss+1, -(alpha+1), -alpha, d, true);