Something's wrong with the equation when you need to plug a number to balance it out.
Not at all, their proportional power is pretty accurate. It's just that EU4's rival/diplomacy system cannot accurately represent actual 15th century diplomacy (because no game possibly can) and needs the occasional stopgap solution to make some historical outcomes possible.
I mean, AI states tend to rival neighbours, and with Portugal's only neighbour being Castile they'd probably rival them 99% of the time. There was a time when AI looked less at proximity when deciding on rivals and this was (rightfully) near-universally despised by players because they couldn't predict AI rival behaviour at all. Thus why you need the historical friends modifier if you want the possibility of Portugal and Spain co-existing.