Skip to content
Permalink
Browse files

Update movepick.cpp

  • Loading branch information...
VoyagerOne committed Jul 11, 2019
1 parent 4ae5a7b commit daaf1e832e084e0fe937797a8d9660b3ee592262
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/movepick.cpp
@@ -174,7 +174,7 @@ Move MovePicker::next_move(bool skipQuiets) {

case GOOD_CAPTURE:
if (select<Best>([&](){
return pos.see_ge(*cur, Value(-55 * cur->value / 1024)) ?
return pos.see_ge(*cur, Value(-cur->value / 18)) ?
// Move losing capture to endBadCaptures to be tried later
true : (*endBadCaptures++ = *cur, false); }))
return *(cur - 1);

3 comments on commit daaf1e8

@protonspring

This comment has been minimized.

Copy link

replied Jul 11, 2019

Dividing by a non-multiple of 2, is pretty expensive.

-7 * cur->value / 128 would probably be better.

@vondele

This comment has been minimized.

Copy link

replied Jul 11, 2019

actually, you'll find that divisions by constants are not so expensive, compilers do fancy stuff, there is no division in a / 18:
https://www.godbolt.org/z/Dzhyqi

@protonspring

This comment has been minimized.

Copy link

replied Jul 11, 2019

Please sign in to comment.
You can’t perform that action at this time.