There definitely is a logic to it - however we have no insight into what that logic is. Unfortunately these rules are part of agreements between airlines and not public to us.
So the only way to get an idea would be to (In order of reliability):
- Buy the ticket, check, and cancel if not to your liking (assuming fare rules allow to cancel)
- Find somebody who recently purchased the same flight/fare and have him/her check
- Lookup the same flight by the operating carrier, and find the fare that comes closest to the codeshare price.