// refine_eval() returns the transposition table score if possible, otherwise // falls back on static position evaluation. static Value refine_eval(TTEntry tte, Value v, Value defaultEval) { if ((((tte.type() & Bound.BOUND_LOWER) != 0) && v >= defaultEval) || (((tte.type() & Bound.BOUND_UPPER) != 0) && v < defaultEval)) return v; return defaultEval; }
static bool can_return_tt(TTEntry tte, Depth depth, Value v, Value beta) { return (tte.depth() >= depth || v >= Math.Max(ValueC.VALUE_MATE_IN_MAX_PLY, beta) || v < Math.Min(ValueC.VALUE_MATED_IN_MAX_PLY, beta)) && ((((tte.type() & Bound.BOUND_LOWER) != 0) && v >= beta) || (((tte.type() & Bound.BOUND_UPPER) != 0) && v < beta)); }