diff options
Diffstat (limited to 'src/solvers/h48')
| -rw-r--r-- | src/solvers/h48/gendata_h48.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/solvers/h48/gendata_h48.h b/src/solvers/h48/gendata_h48.h index 5da9dc3..2f55d3e 100644 --- a/src/solvers/h48/gendata_h48.h +++ b/src/solvers/h48/gendata_h48.h | |||
| @@ -277,6 +277,37 @@ gendata_h48k2(gendata_h48_arg_t *arg) | |||
| 277 | static const uint8_t shortdepth = 8; | 277 | static const uint8_t shortdepth = 8; |
| 278 | static const uint64_t capacity = 10000019; | 278 | static const uint64_t capacity = 10000019; |
| 279 | static const uint64_t randomizer = 10000079; | 279 | static const uint64_t randomizer = 10000079; |
| 280 | |||
| 281 | /* | ||
| 282 | * A good base value for the k=2 tables have few positions with value | ||
| 283 | * 0, because those are treated as lower bound 0 and require a second | ||
| 284 | * lookup in another table, and at the same time not too many positions | ||
| 285 | * with value 3, because some of those are under-estimates. | ||
| 286 | * | ||
| 287 | * The following values for the base have been hand-picked. I first | ||
| 288 | * performed some statistics on the frequency of these values, but | ||
| 289 | * they turned out to be unreliable. I have not figured out why yet. | ||
| 290 | * In the end I resorted to generating the same table with multiple | ||
| 291 | * base value and see what was best. | ||
| 292 | * | ||
| 293 | * A curious case is h3, which has this distribution for base 8: | ||
| 294 | * [0] = 6686828 | ||
| 295 | * [1] = 63867852 | ||
| 296 | * [2] = 392789689 | ||
| 297 | * [3] = 477195231 | ||
| 298 | * | ||
| 299 | * and this for base 9: | ||
| 300 | * [0] = 70554680 | ||
| 301 | * [1] = 392789689 | ||
| 302 | * [2] = 462294676 | ||
| 303 | * [3] = 14900555 | ||
| 304 | * | ||
| 305 | * I ended up picking base 8 to have a much lower count of elements | ||
| 306 | * with value 0, at the cost of a less precise estimate for the higher | ||
| 307 | * values. But I am not 100% confident this is the optimal choice, | ||
| 308 | * so I'll leave it here for future considerations. | ||
| 309 | */ | ||
| 310 | |||
| 280 | static const uint8_t base[] = { | 311 | static const uint8_t base[] = { |
| 281 | [0] = 8, | 312 | [0] = 8, |
| 282 | [1] = 8, | 313 | [1] = 8, |
