Skip to content

Commit

Permalink
Fix null reduction formula
Browse files Browse the repository at this point in the history
Depth is already dependent on the actual value
of ONE_PLY, in particular can be expressed like:

Depth = n * ONE_PLY

And because formula is used to calculate R that is
also dependent on the value of ONE_PLY and can be
expressed like:

R = x * ONE_PLY

We don't want to divide depth by a 'ply' value but
directly by an integer number.

Spotted by sf-x

No functional change.
  • Loading branch information
mcostalba committed Jan 27, 2014
1 parent 2169721 commit f434cea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/search.cpp
Expand Up @@ -632,7 +632,7 @@ namespace {

// Null move dynamic reduction based on depth and value
Depth R = 3 * ONE_PLY
+ depth / (2 * ONE_PLY)
+ depth / 4
+ int(eval - beta) / PawnValueMg * ONE_PLY;

pos.do_null_move(st);
Expand Down

0 comments on commit f434cea

Please sign in to comment.