From: H. Felix Wittmann Date: Tue, 31 Dec 2013 11:24:57 +0000 (+0100) Subject: Simplify move_importance() X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=92faa74dfa862fbdef409017a4ccd993c549f723 Simplify move_importance() Drop a useless parameter. This works because ratio1 and ratio2 are ratios of linear combinations of thisMoveImportance and otherMovesImportance and so the yscale cancels out. Therefore the values of ratio1 and ratio2 are independent of yscale and yscale can be retired. The same applies to yshift, but here we want to ensure move_importance() > 0, so directly hard-code this safety guard in function definition. Actually there are some small differences due to rounding errors and usually are at most few millisecond, that's means below 1% of returned time, apart from very short intervals in which a difference of just 1 msec can raise to 2-3% of total available time. No functional change. --- diff --git a/src/timeman.cpp b/src/timeman.cpp index 81c2f39b..fc2a327d 100644 --- a/src/timeman.cpp +++ b/src/timeman.cpp @@ -34,8 +34,6 @@ namespace { const double xscale = 9.3; const double xshift = 59.8; - const double yscale = 7780; - const double yshift = 1e-3; // Larger than 0. Ensures a non-zero importance const double skewfactor = 0.172; @@ -46,7 +44,7 @@ namespace { double move_importance(int ply) { - return yscale / pow((1 + exp((ply - xshift) / xscale)), skewfactor) + yshift; + return 1 / pow((1 + exp((ply - xshift) / xscale)), skewfactor) + 1e-3; // Ensure non-zero }