Federal income tax calculator for procrastinators Today is Tax Day!

Oops.

Well, today is tax day if you are a resident of Maine or Massachusetts.

So you're probably still completing your return and need a calculator for when you get to Line 44.

Given an input of taxable income (US$, accurate to 2 decimal places) and a string representing filing status, output the amount of tax (also US$ to 2 decimal places).

Filing status will be one of S, MFJ, QW, MFS, or HH for Single, Married Filing Jointly, Qualified Widow(er), Married Filing Separately or Head of Household, respectively.


Tax will be calculated according to the official tables in IRS Revenue Procedure 2014-61, section .01 Tax Rate Tables, Tables 1-4.  I have added these tables at the bottom of the question.
You may choose whatever rounding method you like, as long as the result is accurate to 2 decimal places.


Example Inputs:

0.00 S
10000.00 MFJ
100000.00 MFS
1000000.00 QW


Example Outputs corresponding to above inputs:

0.00
1000.00
21525.75
341915.90




Summary of tax tables.

Married Filing Jointly and Qualified Widow(er)


  Income Interval       Tax
  [     $0,  $18450]                 10%
  ( $18450,  $74900]      $1845    + 15%   of the excess over  $18450
  ( $74900, $151200]     $10312.50 + 25%   of the excess over  $74900
  ($151200, $230450]     $29387.50 + 28%   of the excess over $151200
  ($230450, $411500]     $51577.50 + 33%   of the excess over $230450
  ($411500, $464850]    $111324    + 35%   of the excess over $411500
  ($464850,      $∞]    $129996.50 + 39.6% of the excess over $464850


Head of Household


  Income Interval       Tax
  [     $0,  $13150]                 10%
  ( $13150,  $50200]      $1315    + 15%   of the excess over  $13150
  ( $50200, $129600]      $6872.50 + 25%   of the excess over  $50200
  ($129600, $209850]     $26722.50 + 28%   of the excess over $129600
  ($209850, $411500]     $49192.50 + 33%   of the excess over $209850
  ($411500, $439000]    $115737    + 35%   of the excess over $411500
  ($439000,      $∞]    $125362    + 39.6% of the excess over $439000


Single


  Income Interval       Tax
  [     $0,   $9225]                 10%
  (  $9225,  $37450]       $922.50 + 15%   of the excess over   $9225
  ( $37450,  $90750]      $5156.25 + 25%   of the excess over  $37450
  ( $90750, $189300]     $18481.25 + 28%   of the excess over  $90750
  ($189300, $411500]     $46075.25 + 33%   of the excess over $189300
  ($411500, $413200]    $119401.25 + 35%   of the excess over $411500
  ($413200,      $∞]    $119996.25 + 39.6% of the excess over $413200


Married Filing Separately


  Income Interval       Tax
  [     $0,   $9225]                 10%
  (  $9225,  $37450]       $922.50 + 15%   of the excess over   $9225
  ( $37450,  $75600]      $5156.25 + 25%   of the excess over  $37450
  ( $75600, $115225]     $14693.75 + 28%   of the excess over  $75600
  ($115225, $205750]     $25788.75 + 33%   of the excess over $115225
  ($205750, $232425]     $55662    + 35%   of the excess over $205750
  ($232425,      $∞]     $64998.25 + 39.6% of the excess over $232425
Python 3, 427 382 317 309 308 275 bytes

-45 bytes by figuring ternary expression out (wow that's a long line); thanks Maltysen

-65 bytes, now with iteration for DRYer code!

-8 bytes by in-lining tuple variables; thanks Majora

-1 byte by using a dict rather than ternary chain; thanks again Maltysen

-33 bytes by reusing MFS step as half of MFJ/QW and calculating tax an order of magnitude larger; thanks Neil



def f(i,s):
 t=i;k={'MFS':(9225,28225,38150,39625,90525,26675),'S':(9225,28225,53300,98550,222200,1700),'HH':(13150,37050,79400,80250,201650,27500)}
 for x in range(6):
  i-=k[s][x]if s in k else k['MFS'][x]*2
  if i&gt;0:t+=(.5,1,.3,.5,.2,.46)[x]*i
 return'{:.2f}'.format(t*.1)


If I had been thinking I would have made the function signature t(a,x), but I guess I'll stick with function(income, status).

When code is barely undertstood by the writer, is that when you win at golf?