Skip to content

Fix fiitax to include Additional Medicare Tax#713

Draft
PavelMakarchuk wants to merge 1 commit intomainfrom
fix-addl-medicare-tax-in-fiitax
Draft

Fix fiitax to include Additional Medicare Tax#713
PavelMakarchuk wants to merge 1 commit intomainfrom
fix-addl-medicare-tax-in-fiitax

Conversation

@PavelMakarchuk
Copy link
Collaborator

Summary

  • PE's income_tax variable does not include Additional Medicare Tax (0.9% on wages above $200K single / $250K MFJ), but TAXSIM includes it in fiitax (per IRS Form 1040 Schedule 2)
  • The existing code at lines 1099-1108 tried to add additional_medicare_tax to fiitax, but the else branch was dead code — fiitax was always already computed from the income_tax mapping, so the pass branch ran instead
  • Fix: always compute additional_medicare_tax and add it to fiitax

Impact on CPS comparison (1000 records, with --disable-salt --assume-w2-wages):

  • Total absolute error reduced by 44% ($12.1M → $6.7M)
  • 115 records improved, 30 worsened (mostly from TAXSIM's own Additional Medicare Tax calculation differences)
  • At $15 tolerance: 4 borderline records near the threshold break (PE correctly computes $85-$179 of Additional Medicare Tax that TAXSIM doesn't)
  • At $500+ tolerance: +12 to +43 more matches

Test plan

  • All 38 existing tests pass
  • Verified against TAXSIM output for 1000 CPS records
  • Confirmed PE's Additional Medicare Tax calculation matches IRS Schedule SE / Form 8959

🤖 Generated with Claude Code

The code at lines 1099-1108 intended to add additional_medicare_tax to
fiitax, but the else branch was dead code — fiitax was always already
in columns from the income_tax mapping, so the pass branch ran instead.

Now additional_medicare_tax is always computed and added to fiitax,
matching TAXSIM's treatment (which includes it per IRS Form 1040
Schedule 2, Line 23).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant