Improved formula to determine search depth.