From: 31m059 <37052095+31m059@users.noreply.github.com> Date: Sun, 14 Jul 2019 12:40:45 +0000 (-0400) Subject: Linear formula for w. Bench: 3328507 (#2239) X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=a0360cc2d4397edaad590cdf131fef95915b55c0;hp=ff69d570d774c465b63ed65f8f14afdaac4eb107;ds=sidebyside Linear formula for w. Bench: 3328507 (#2239) In Stockfish, both the middlegame and endgame bonus for a passed pawn are calculated as a product of two factors. The first is k, chosen based on the presence of defended and unsafe squares. The second is w, a quadratic function of the pawn's rank. Both are only applied if the pawn's relative rank is at least RANK_4. It does not appear that the complexity of a quadratic function is necessary for w. Here, we replace it with a simpler linear one, which performs equally at both STC and LTC. STC: LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 46814 W: 10386 L: 10314 D: 26114 http://tests.stockfishchess.org/tests/view/5d29686e0ebc5925cf0d76a1 LTC: LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 82372 W: 13845 L: 13823 D: 54704 http://tests.stockfishchess.org/tests/view/5d2980650ebc5925cf0d7bfd Bench: 3328507 --- diff --git a/src/evaluate.cpp b/src/evaluate.cpp index a52cdf09..b20c93b7 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -622,7 +622,7 @@ namespace { if (r > RANK_3) { - int w = (r-2) * (r-2) + 2; + int w = 5 * r - 13; Square blockSq = s + Up; // Adjust bonus based on the king's proximity