refined boundary tests for inv, inv_sqrt, inv_square