summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
153309e)
In case ply is very high, function will round
to zero (although mathematically it is always
bigger than zero). On my system this happens at
movenumber 6661.
Although 6661 moves in a game is, of course,
probably impossible, for safety and to be locally
consistent makes sense to ensure returned value
is positive.
Non functional change.
#include <cmath>
#include "search.h"
#include <cmath>
#include "search.h"
double move_importance(int ply) {
double move_importance(int ply) {
- return pow((1 + exp((ply - xshift) / xscale)), -skewfactor);
+ return pow((1 + exp((ply - xshift) / xscale)), -skewfactor) + DBL_MIN; // Ensure non-zero