mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 17:16:33 +08:00
Rearrange interpolation formula
Put the division at the end to reduce rounding errors. This alters the bench due to different rounding errors, but should not alter ELO in any way. bench: 7615217
This commit is contained in:
@@ -779,9 +779,9 @@ namespace {
|
||||
sf = ScaleFactor(50 * sf / SCALE_FACTOR_NORMAL);
|
||||
}
|
||||
|
||||
// Interpolate between a middlegame and an endgame score, scaling by 'sf'
|
||||
// Interpolate between a middlegame and a (scaled by 'sf') endgame score
|
||||
Value v = mg_value(score) * int(ei.mi->game_phase())
|
||||
+ eg_value(score) * int(sf) / SCALE_FACTOR_NORMAL * int(PHASE_MIDGAME - ei.mi->game_phase());
|
||||
+ eg_value(score) * int(PHASE_MIDGAME - ei.mi->game_phase()) * sf / SCALE_FACTOR_NORMAL;
|
||||
|
||||
v /= PHASE_MIDGAME;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user