mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 00:33:09 +00: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:
parent
918c29f83a
commit
db229504e2
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue