From 62ca23627f50382d99348bea2601469b235d7243 Mon Sep 17 00:00:00 2001 From: rektdie Date: Tue, 18 Mar 2025 20:24:35 +0100 Subject: [PATCH] changed to log formula | bench 412557 --- source/search.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/source/search.cpp b/source/search.cpp index eedb753..b0f7e22 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -2,6 +2,7 @@ #include "movegen.h" #include "evaluate.h" #include +#include #include "tt.h" #include "stopwatch.h" @@ -95,12 +96,15 @@ static bool IsThreefold(Board &board) { return false; } -static int GetReductions(Board &board, int depth, int moveSeen) { +static int GetReductions(Board &board, int depth, int moveSeen, int ply) { int reduction = 0; // Late Move Reduction - if (!board.InCheck(board.sideToMove) && moveSeen >= 5 && depth > 3) { - reduction++; + if (depth >= 3 && moveSeen >= 5 + 2 * (ply == 0) && !board.InCheck(board.sideToMove)) { + double base = 0.77; + double divisor = 2.36; + + reduction = std::round(base + std::log(depth) * std::log(moveSeen) / divisor); } return reduction; @@ -229,7 +233,7 @@ SearchResults PVS(Board board, int depth, int alpha, int beta, int ply) { Board copy = board; copy.MakeMove(currMove); - int reductions = GetReductions(board, depth, i); + int reductions = GetReductions(board, depth, i, ply); // First move (suspected PV node) if (!i) {