+ // Decrease reduction if position is or has been on the PV
+ // and node is not likely to fail low. (~3 Elo)
+ // Decrease further on cutNodes. (~1 Elo)
+ if ( ss->ttPv
+ && !likelyFailLow)
+ r -= cutNode && tte->depth() >= depth + 3 ? 3 : 2;
+
+ // Decrease reduction if opponent's move count is high (~1 Elo)
+ if ((ss-1)->moveCount > 8)
+ r--;
+
+ // Increase reduction for cut nodes (~3 Elo)
+ if (cutNode)
+ r += 2;
+
+ // Increase reduction if ttMove is a capture (~3 Elo)
+ if (ttCapture)
+ r++;
+
+ // Decrease reduction for PvNodes based on depth (~2 Elo)
+ if (PvNode)
+ r -= 1 + 12 / (3 + depth);
+
+ // Decrease reduction if ttMove has been singularly extended (~1 Elo)
+ if (singularQuietLMR)
+ r--;
+
+ // Increase reduction if next ply has a lot of fail high (~5 Elo)
+ if ((ss+1)->cutoffCnt > 3)
+ r++;
+
+ else if (move == ttMove)
+ r--;
+
+ ss->statScore = 2 * thisThread->mainHistory[us][from_to(move)]
+ + (*contHist[0])[movedPiece][to_sq(move)]
+ + (*contHist[1])[movedPiece][to_sq(move)]
+ + (*contHist[3])[movedPiece][to_sq(move)]
+ - 4006;
+
+ // Decrease/increase reduction for moves with a good/bad history (~25 Elo)
+ r -= ss->statScore / (11124 + 4740 * (depth > 5 && depth < 22));
+
+ // Step 17. Late moves reduction / extension (LMR, ~117 Elo)