The "source code" to the calculations are the paper forms which specify the calculations, making them transparent.
First, yes, we calculate our own income tax, but the IRS also calculates it separately, and if the two disagree, they selectively decide whether to come knocking. (For example, they once tried to bill me $300,000 for a tax year when my net income was just over $100,000, because of multiple clerical errors -- we had sold a house, and they had both erroneously tried to apply capital gains tax where it didn't apply at all, and tried to tax us for the full sale price of the house as though we had bought it for $0 and flipped it. It took months of back and forth to fix the issue, despite everything having been clearly documented.)
Second, calculating tax liability is just the first step. Actually submitting tax returns electronically required a third party for a long time, and I believe it still does for all but the most straightforward returns. There's absolutely no reason for that to be the case, other than the outsize influence of lobbying money.
That's without getting into all the loopholes, dodges, and hand-waving that make it possible for someone like Trump to avoid paying taxes entirely most years, while those of us who they know can't afford to lawyer up are the ones they try to collect from.
If the two disagree in a calculation matter, the calculations spelled out in the tax form should be upheld as the gold standard as to which side made the calculation error.
> they had both erroneously tried to apply capital gains tax where it didn't apply at all
Was this issue due to paper tax forms doing a calculation one way, but the IRS's implementation doing it another way?
Most recently, I screwed up by claiming a credit that was not allowed. However, the conditions for it are documented; I was wrong. This is where code could help, in order to clarify obtuse language in the requirements. Obviously, the government runs code which checks the conditions that determine whether a nonzero amount can be claimed in some field, so it's just another calculation. Still, it would be better for that to be crystal clear pseudo-code and not the fragment of some actual implementation.
Should, yeah.
> Was this issue due to paper tax forms doing a calculation one way, but the IRS's implementation doing it another way?
No, it was straight up wrong, and could only have been human error. As far as I can make out, their calculation only made sense if you took the full printed tax return and lost the back half of it. (And also ignored the part of the law that says capital gains tax doesn’t apply if you lived in a home more than two years before selling).