- + 18 * pawnsOnBothFlanks
- + 49 * !pos.non_pawn_material()
- - 36 * almostUnwinnable
- -103 ;
-
- // Now apply the bonus: note that we find the attacking side by extracting
- // the sign of the endgame value, and that we carefully cap the bonus so
- // that the endgame score will never change sign after the bonus.
+ + 12 * infiltration
+ + 21 * pawnsOnBothFlanks
+ + 51 * !pos.non_pawn_material()
+ - 43 * almostUnwinnable
+ - 100 ;
+
+ // Now apply the bonus: note that we find the attacking side by extracting the
+ // sign of the midgame or endgame values, and that we carefully cap the bonus
+ // so that the midgame and endgame scores do not change sign after the bonus.
+ int u = ((mg > 0) - (mg < 0)) * std::max(std::min(complexity + 50, 0), -abs(mg));