by tvanantwerp · 8y ago · 0 comments
Edit: The more I play with this, the more flaws I find. I work at a tax policy think tank and I've been involved with more than a few tax calculators, and this one isn't reliable. It fails basic tests, like applying the standard deduction if itemized deductions are less than that amount.
Second edit: Here's a tip. It's a lot easier to calculate marginal rates on income if you go through the brackets backward rather than forward. That way, you just check if income is >= the current bracket threshold. If yes, subtract threshold from income, add that multiplied by the rate to the running total of taxes owed, and move to the next bracket. Else, just move to the next bracket. Way easier than what you're doing.
Re tax brackets, we are looking to add state tax soon so it is much easier not to hardcore the running totals. The computation time is insignificant but code is cleaner with our current method, IMO.
Yeah, this is the difference between the calculator showing a $2K tax hike for me, and a $2K cut.