- 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;
- for (int i : {3, 4, 5})
- if (lastBestMoveDepth * i < completedDepth)
- timeReduction *= 1.25;
-
- // Use part of the gained time from a previous stable move for the current move
- double bestMoveInstability = 1.0 + mainThread->bestMoveChanges;
- bestMoveInstability *= std::pow(mainThread->previousTimeReduction, 0.528) / timeReduction;
-
- // Stop the search if we have only one legal move, or if available time elapsed
- if ( rootMoves.size() == 1
- || 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".
- if (Threads.ponder)
- Threads.stopOnPonderhit = true;
- else
- Threads.stop = true;
- }
+ // If we are allowed to ponder do not stop the search now but
+ // keep pondering until the GUI sends "ponderhit" or "stop".
+ if (mainThread->ponder)
+ mainThread->stopOnPonderhit = true;
+ else
+ Threads.stop = true;