X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=24ca7e40963e5e8fae00f6d32a94f8d105c859d3;hp=b43ab7e5be1a387f34c296f5a1afb39e17d38cf3;hb=45dbd9cd0303d0db469670af8ec3598731a4eace;hpb=153309e28702d8e5f49f4772bfb61f9f9ed965fc diff --git a/src/evaluate.cpp b/src/evaluate.cpp index b43ab7e5..24ca7e40 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -87,9 +87,6 @@ namespace { Bitboard pinnedPieces[COLOR_NB]; }; - // Evaluation grain size, must be a power of 2 - const int GrainSize = 4; - // Evaluation weights, initialized from UCI options enum { Mobility, PawnStructure, PassedPawns, Space, KingDangerUs, KingDangerThem }; Score Weights[6]; @@ -926,8 +923,7 @@ Value do_evaluate(const Position& pos) { assert(ph >= PHASE_ENDGAME && ph <= PHASE_MIDGAME); int e = (eg_value(v) * int(sf)) / SCALE_FACTOR_NORMAL; - int r = (mg_value(v) * int(ph) + e * int(PHASE_MIDGAME - ph)) / PHASE_MIDGAME; - return Value((r / GrainSize) * GrainSize); // Sign independent + return Value((mg_value(v) * int(ph) + e * int(PHASE_MIDGAME - ph)) / PHASE_MIDGAME); } // apply_weight() weights score v by score w trying to prevent overflow