void update(T& entry, int bonus, const int D) {
- assert([&]{
- int v = entry + bonus * 32 - entry * abs(bonus) / D;
- return INT16_MIN < v && v < INT16_MAX;
- }());
-
- assert(abs(bonus) <= D); // Consistency check for below formula
+ assert(abs(bonus) <= D); // Ensure range is [-32 * D, 32 * D]
+ assert(abs(32 * D) < INT16_MAX); // Ensure we don't overflow
entry += bonus * 32 - entry * abs(bonus) / D;
MovePicker(const MovePicker&) = delete;
MovePicker& operator=(const MovePicker&) = delete;
MovePicker(const Position&, Move, Value);
- MovePicker(const Position&, Move, Depth, const ButterflyHistory*, const PieceToHistory**, Square);
+ MovePicker(const Position&, Move, Depth, const ButterflyHistory*, Square);
MovePicker(const Position&, Move, Depth, const ButterflyHistory*, const PieceToHistory**, Move, Move*);
Move next_move(bool skipQuiets = false);