@dtech said:

I don't know exactly why and how this is used, but isn't that the easiest way if you want to do something, well, when either condition P or not condition P but condition Q?

P || (!P && Q) is logically equivalent to P || Q, but you hit on the cause of the pattern: bad requirements gathering. Someone phrased the problem as, "Do it if the date is in the future, but also do it if the interest is compounded as long as the date is not in the future." That could be interpreted as the above, which is the same as "Do it if the date is in the future or the interest is compounded." Or it could be interpreted as (P && !Q) || (!P && Q): "Do it if the date is in the future _except if the interest is compounded_; do it if the interest is compounded as long as the date is not in the future."