Your rule becomes, with y >= x the ages, (x >= 2/3 y + 8/3 AND x >= 16) OR x >= 18.

One feature of these linear rules I will mention: they have an implicit lower cutoff. For the half-plus-seven rule, if the older age is 14, then the younger age is 14/7 + 7 = 14, also 14. There’s a certain elegance in having the lower cutoff built into the inequality, but perhaps you would want to make explicit an absolute minimum age for legal clarity.

https://en.wikipedia.org/wiki/Age_disparity_in_sexual_relationships#%22Half-your-age-plus-seven%22_rule

https://www.dictionary.com/e/slang/half-your-age-plus-seven/

https://www.urbandictionary.com/define.php?term=Half%20plus%20seven