diff --git a/src/search.c b/src/search.c index 3c7a9853..87948a0a 100644 --- a/src/search.c +++ b/src/search.c @@ -612,10 +612,19 @@ int negamax(int alpha, int beta, int depth, board* position, time* time, bool cu continue; } + bool isNotMated = alpha > -mateScore + maxPly; if (!rootNode && isQuiet && isNotMated) { + int lmpBase = 4; + int lmpMultiplier = 3; + int lmpThreshold = (lmpBase + lmpMultiplier * depth * depth); + + if (legal_moves>= lmpThreshold) { + skipQuiet = 1; + } + if (canPrune && depth <= 2 && static_eval + 82 * depth <= alpha) { skipQuiet = 1; }