X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;fp=src%2Fevaluate.cpp;h=586cadc0ec50c6cb5fe211aaecd7ad1efa755afc;hp=9c39d4c07fbb407ed7934dc14ab118994615c557;hb=a069a1bbbfb60abddbe3fe5276b06f35f783f41c;hpb=07a2619b62a25910a32ad8a4e9912f748338580f diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 9c39d4c0..586cadc0 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -164,9 +165,9 @@ Value Eval::evaluate(const Position& pos) { int shuffling = pos.rule50_count(); int simpleEval = simple_eval(pos, stm) + (int(pos.key() & 7) - 3); - bool lazy = abs(simpleEval) >= RookValue + KnightValue + 16 * shuffling * shuffling - + abs(pos.this_thread()->bestValue) - + abs(pos.this_thread()->rootSimpleEval); + bool lazy = std::abs(simpleEval) >= RookValue + KnightValue + 16 * shuffling * shuffling + + std::abs(pos.this_thread()->bestValue) + + std::abs(pos.this_thread()->rootSimpleEval); if (lazy) v = Value(simpleEval); @@ -178,8 +179,8 @@ Value Eval::evaluate(const Position& pos) { Value optimism = pos.this_thread()->optimism[stm]; // Blend optimism and eval with nnue complexity and material imbalance - optimism += optimism * (nnueComplexity + abs(simpleEval - nnue)) / 512; - nnue -= nnue * (nnueComplexity + abs(simpleEval - nnue)) / 32768; + optimism += optimism * (nnueComplexity + std::abs(simpleEval - nnue)) / 512; + nnue -= nnue * (nnueComplexity + std::abs(simpleEval - nnue)) / 32768; int npm = pos.non_pawn_material() / 64; v = (nnue * (915 + npm + 9 * pos.count()) + optimism * (154 + npm)) / 1024;