X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=6a63fcaa338910a221d2770374faea8ead35f183;hp=e63d72e85e4d1e08602701e3c006ca17aae0718d;hb=b19ad4977c0ee427eeff9c11bd7c4da9210cd090;hpb=33d95482182e459eb033de47a31f142880aa9afb diff --git a/src/search.cpp b/src/search.cpp index e63d72e8..6a63fcaa 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -492,10 +492,8 @@ void Thread::search() { && !Threads.stop && !Threads.stopOnPonderhit) { - const int F[] = { failedLow, - bestValue - mainThread->previousScore }; - - int improvingFactor = std::max(246, std::min(832, 306 + 119 * F[0] - 6 * F[1])); + double fallingEval = (306 + 119 * failedLow + 6 * (mainThread->previousScore - bestValue)) / 581.0; + fallingEval = std::max(0.5, std::min(1.5, fallingEval)); // If the bestMove is stable over several iterations, reduce time accordingly timeReduction = 1.0; @@ -509,7 +507,7 @@ void Thread::search() { // Stop the search if we have only one legal move, or if available time elapsed if ( rootMoves.size() == 1 - || Time.elapsed() > Time.optimum() * bestMoveInstability * improvingFactor / 581) + || Time.elapsed() > Time.optimum() * bestMoveInstability * fallingEval) { // If we are allowed to ponder do not stop the search now but // keep pondering until the GUI sends "ponderhit" or "stop".