I am no lawyer but I am law-curious, so I went looking for more info on rangeCheck. As we all know AI erases liability, but I'm a poor old human still trying to compete with AI and I do have legal liability so I guess I still have to think about what the rules mean, eh?
Here's my thing: Oracle v Google was a fight that ended up being about two specific things, one was whether API-declaring interface code could be a subject of copyright law. Once it was found that interfaces could be copyrighted the lawsuit turned its focus to thing two: whether Google's use was fair use.
The part of copyright law, as written, that protects your ability to copy a 9-line RangeCheck function, is NOT, emphatically NOT fair use. It is convergence, the least-known of all the copyright principles.
Convergence says that if many people not coordinating could be expected to all land on the same results, then logically the activity must not be creative expression and the result must not be possible to copyright. This is why nobody owns math equations like e=mc^2. It's not that no creativity was required to derive the equation, it's that anyone working at it would end up with a result of that form.
In programming this would protect you when you do something like write a parser for a programming language, or implement a common helper function. Anything where you may, through now fault of your own, do work that creates a result similar to work that someone else has already done.
I don't know that any significant court case has ever even had arguments based on convergence even though it's the most practical shield most of us have most of the time.