This is something I learned: When coding for this kind of legal tests just make your code read as close as possible to how the actual law reads.
It's easier to check that the code matches the law (after all there are no test vectors on the law apart from case law so you have to go by the drafting) and it makes updates when an amendment is made much simpler.
It's easier to check that the code matches the law (after all there are no test vectors on the law apart from case law so you have to go by the drafting) and it makes updates when an amendment is made much simpler.
That, and there is usually zero need to optimise.