X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=832501f2f70d94437625b35c836692b63f86c2fa;hp=548ea9143d37c48f3aeec316744803a797c13aa1;hb=82697f1193cc8c99c99c282361a3ada25c758243;hpb=65c3bb8586eba11277f8297ef0f55c121772d82c diff --git a/src/search.cpp b/src/search.cpp index 548ea914..832501f2 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -351,10 +351,7 @@ void Thread::search() { ct = Options["Contempt"] * PawnValueEg / 100; // From centipawns // Adjust contempt based on current bestValue (dynamic contempt) - int sign = (bestValue > 0) - (bestValue < 0); - ct += bestValue > 500 ? 70 : - bestValue < -500 ? -70 : - bestValue / 10 + sign * int(std::round(3.22 * log(1 + abs(bestValue)))); + ct += int(std::round(48 * atan(float(bestValue) / 128))); Eval::Contempt = (us == WHITE ? make_score(ct, ct / 2) : -make_score(ct, ct / 2));