Skip to content

Commit aef7076

Browse files
ceebosnicolet
authored andcommitted
Alternative formula for dynamic contempt
Replace the formula involving arctan with something having similar behaviour that can be implemented using integer-only operations. STC: LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 34781 W: 7189 L: 7093 D: 20499 http://tests.stockfishchess.org/tests/view/5ad7c95f0ebc595700526e76 LTC: LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 39743 W: 5950 L: 5857 D: 27936 http://tests.stockfishchess.org/tests/view/5ad886ee0ebc595700526e9b Closes #1558 Bench: 5549801
1 parent a64d524 commit aef7076

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/search.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ void Thread::search() {
379379
beta = std::min(previousScore + delta, VALUE_INFINITE);
380380

381381
// Adjust contempt based on root move's previousScore (dynamic contempt)
382-
int dct = ct + int(std::round(48 * atan(float(previousScore) / 128)));
382+
int dct = ct + 88 * previousScore / (abs(previousScore) + 200);
383383

384384
contempt = (us == WHITE ? make_score(dct, dct / 2)
385385
: -make_score(dct, dct / 2));

0 commit comments

Comments
 (0)