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
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;