Some time ago, I wrote code to generate a sort of heat map of the marriage penalty/bonus in US tax law. If these charts make no sense, that's kind of the point: it's a weird and arbitrary feature of the tax code with no obvious rationale.