Closed jdebacker closed 8 months ago
Payroll tax is good to pass, with details can be found in the payroll tax validation issue.
Taxsim35 is going through update, with FICA tax calculation method change.
The updated version of Taxsim and Tax-Calculator show no difference in FICA tax calculation result
The updated version of Taxsim does not provide SECA tax result, so we cannot do validation of SECA tax. However, I've tried to compare the SECA tax result from Tax-Calculator and my manual calculation, of many randomly selected records in different sets among different years. The results are correct.
So payrolltax (FICA+SECA) validation should be considered to pass
AGI c00100 validation:
I have manually calculated the AGE c00100 variable in "b", "c" sets for all years.
Tax-Calculator's result should be correct.
Some detailed analysis:
c00100 = ymod1 + c02500 - c02900 + taxable_ubi
Under Taxsim's variable name: ymod1 = pwages + swages + psemp + ssemp + dividends + intrec + otherprop + nonprop + pensions + pui +sui + scorp + pbusinc + sbusinc + MAX(-3000, stcg + ltcg)
c02500, social security benefit in AGI, is calculated based on gssi variable from Taxsim. I have manually calculated this item following Social Security Benefits Worksheet -- line 20a and 20b, in 1040 instructions. The result of c02500 matches with Tax-Calculator's result
taxable_ubi is Zero for all years in the validation sets, so there is no problem with this item
c02900, total of all "above the line" income adjustments to get AGI: This variable is consisted of many items, as in form 1040 Sch 1 . However, the only variable which is not zero, in this validation, is Deductible part of self-employment tax e03260. And since *e03260 = 0.5 setax** , we only need to conduct the validation of self-employment tax. From my last comment, SECA tax validation issue should not be concerned
So the c00100 AGI in Tax-Calculator should be correct. ~ difference of c00100 in Taxsim is likely come from the SECA tax calculation process (as mentioned before, Taxsim's payroll tax calculation is under the work of update)
c11070 Child Tax Credit for 2021 validation:
For year 2021, Child tax credit is categorized as nonrefundable child tax credit. So c11070 as the refunded Child tax credit is count as zero in Tax-Calculator. Taxsim35 calculates the amount of Child tax credit (it does not differentiate refundable vs nonrefundable credit) This issue is the same as and has been documented in the "a" set validation PR
@bodiyang Thanks for reviewing the differences.
Re c11070
: The issue of refundability or not (and where counted) should be handled for 2021 via this fix to the taxcalc output. That's where there's no difference in this variable in the "a" set validation for 2021. So I believe the 6 records with differences in the 2021 "b" file are due to something else.
Re c00100
, I don't think we can be confident in the overall AGI until we have the intermediate variables (such a c11070
taken care of). The diffs in AGI are pointing to underlying difference in the calculation of the components, so differences here not just reflecting the direct computation of the AGI you noted above.
Re the payroll taxes -- thanks for noting these known differences. Due to this, let's focus n getting the AGI/iitax difference to zero (or explaining any diffs) and not worry about payroll taxes.
@jdebacker
For c00100: I've already compared the intermediate variables, which are involved in c00100 calculation
note: c11070 is involved in the iitax calculation, but not c00100 AGI calculation
As documented in the previous comment: c00100 = ymod1 + c02500 - c02900 + taxable_ubi intermediate variables here are ymod1, c02500, c02900 and taxable_ubi We cannot get the value of these from Taxsim, so the way of validation is to compare the value of these intermediate variables from Tax-Calculator with manual calculation from tax forms.
ymod1 = pwages + swages + psemp + ssemp + dividends + intrec + otherprop + nonprop + pensions + pui +sui + scorp + pbusinc + sbusinc + MAX(-3000, stcg + ltcg) ymod1 is calculated directly from the input variable, and the value of this is correct.
other intermediate variables, c02500, c02900, taxable_ubi can be found at the details here
amt_liability is correct in Tax-Calculator
Taxsim zero out all of the amt_liability result, so should not be considered in the validation. I've conduct manual calculation (in both 'b' & 'c' sets, from different years) following tax form 6251 and the manual calculation results all match with the Tax-Calculator's results.
Can you explain what you mean by "taxsim zero out all of the amt_liability result"? Are you referring to a taxsim output variable? What name? I am on vacation and will return to Cambridge on December 21, and can fix problems then.
Dan 617-682-6204
On Fri, 15 Dec 2023, Bodi Yang wrote:
amt_liability is correct in Tax-Calculator
Taxsim zero out all of the amt_liability result, so should not be considered in the validation. I've conduct manual calculation (of different records from different years) following tax form 6251 and the manual calculation results all match with the Tax-Calculator's results.
-- Reply to this email directly or view it on GitHub: https://github.com/PSLmodels/Tax-Calculator/pull/2705#issuecomment-1858405159 You are receiving this because you are subscribed to this thread.
Message ID: @.***>
Can you explain what you mean by "taxsim zero out all of the amt_liability result"? Are you referring to a taxsim output variable? What name? I am on vacation and will return to Cambridge on December 21, and can fix problems then. Dan 617-682-6204 … On Fri, 15 Dec 2023, Bodi Yang wrote: amt_liability is correct in Tax-Calculator Taxsim zero out all of the amt_liability result, so should not be considered in the validation. I've conduct manual calculation (of different records from different years) following tax form 6251 and the manual calculation results all match with the Tax-Calculator's results. -- Reply to this email directly or view it on GitHub: #2705 (comment) You are receiving this because you are subscribed to this thread. Message ID: @.***>
Taxsim's AMT calculation output ('27.AMT' in 'Federal tax calculation') is always zero, for all records which should have AMT.
As an example:
taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl
This record should have $20401 AMT liability, but Taxsim is showing zero for the AMT output.
Bodi
non_refundable_child_odep_credit is correct in Tax-Calculator.
The result of my manual calculation match with the Tax-Calculator's result. To be noticed both Taxcalc and Taxsim do not consider the $1,000 rounding rule for the year 2021, as documented in issue
example record in c21: taxsimid 222 year 2021 state mstat 2 page 75 sage 74 depx 3 dep13 3 dep17 3 dep18 3 pwages 14000 swages 20000 psemp 278 ssemp 281 dividends 18000 intrec 5000 stcg 0 ltcg -2000 otherprop 3000 nonprop 26000 pensions 16000 gssi 16000 pui 10000 sui 7000 transfers 0 rentpaid 0 proptax 6000 otheritem 10000 childcare 4000 mortgage 39000 scorp 165000 pbusinc 121000 pprofinc 0 sbusinc 114000 sprofinc
So Tax-Calculator does slight off by the manual calculation, this is because of the $1,000 rounding rule mentioned in the issue above; I don't see the reason why Taxsim is off
manual calculation is in IMG_5185.HEIC.zip
The above is an example record. I have gone through records in both 'b' & 'c' set and Tax-Calculator should be correct.
@jdebacker I'm including both 'b' and 'c' sets validation in this PR, because they are showing similar differences.
I am concerned that apparently this taxpayer with mstat=1 has both pui and sui non-zero. Taxsim checks for that, so perhaps sui is intended to be zero? I'll continue working under that assumption. It would help if sent all the results for this taxpayer, and possibly your calculation.
Daniel Feenberg 617-682-6204
On 12/18/23, Bodi Yang @.***> wrote:
Can you explain what you mean by "taxsim zero out all of the amt_liability result"? Are you referring to a taxsim output variable? What name? I am on vacation and will return to Cambridge on December 21, and can fix problems then. Dan 617-682-6204 … On Fri, 15 Dec 2023, Bodi Yang wrote: amt_liability is correct in Tax-Calculator Taxsim zero out all of the amt_liability result, so should not be considered in the validation. I've conduct manual calculation (of different records from different years) following tax form 6251 and the manual calculation results all match with the Tax-Calculator's results. -- Reply to this email directly or view it on GitHub: #2705 (comment) You are receiving this because you are subscribed to this thread. Message ID: @.***>
Taxsim's AMT calculation output ('27.AMT' in 'Federal tax calculation') is always zero, for all records which should have AMT.
As an example:
taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl
This record should have $20401 AMT liability, but Taxsim is showing zero for the AMT output.
-- Reply to this email directly or view it on GitHub: https://github.com/PSLmodels/Tax-Calculator/pull/2705#issuecomment-1860682145 You are receiving this because you commented.
Message ID: @.***>
I am concerned that apparently this taxpayer with mstat=1 has both pui and sui non-zero. Taxsim checks for that, so perhaps sui is intended to be zero? I'll continue working under that assumption. It would help if sent all the results for this taxpayer, and possibly your calculation. Daniel Feenberg 617-682-6204 … On 12/18/23, Bodi Yang @.> wrote: > Can you explain what you mean by "taxsim zero out all of the amt_liability > result"? Are you referring to a taxsim output variable? What name? I am on > vacation and will return to Cambridge on December 21, and can fix problems > then. Dan 617-682-6204 > … > On Fri, 15 Dec 2023, Bodi Yang wrote: amt_liability is correct in > Tax-Calculator Taxsim zero out all of the amt_liability result, so should > not be considered in the validation. I've conduct manual calculation (of > different records from different years) following tax form 6251 and the > manual calculation results all match with the Tax-Calculator's results. -- > Reply to this email directly or view it on GitHub: [#2705 > (comment)](#2705 (comment)) > You are receiving this because you are subscribed to this thread. Message > ID: @.> Taxsim's AMT calculation output ('27.AMT' in 'Federal tax calculation') is always zero, for all records which should have AMT. As an example: taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl This record should have $20401 AMT liability, but Taxsim is showing zero for the AMT output. -- Reply to this email directly or view it on GitHub: #2705 (comment) You are receiving this because you commented. Message ID: @.***>
The result I got from taxsim of this record is: income tax $95709.64. payroll tax $27665.4. AGI $ 519936.6
My manual calculation can be found in the attached picture zip file in my previous comment
Best, Bodi
On Mon, 25 Dec 2023, Bodi Yang wrote:
My manual calculation can be found in the attached picture zip file in my previous comment
At that page I see highlighted a link to a for 8812 that is not relevant.
Daniel Feenberg 617-682-6204
Best, Bodi
-- Reply to this email directly or view it on GitHub: https://github.com/PSLmodels/Tax-Calculator/pull/2705#issuecomment-1869138787 You are receiving this because you commented.
Message ID: @.***>
On Mon, 25 Dec 2023, Bodi Yang wrote: My manual calculation can be found in [the attached picture zip file in my previous comment](#2705 (comment)) At that page I see highlighted a link to a for 8812 that is not relevant. Daniel Feenberg 617-682-6204 … Best, Bodi -- Reply to this email directly or view it on GitHub: #2705 (comment) You are receiving this because you commented. Message ID: @.***>
Oh I see, we probably end up talking about different issues in this PR. Sorry about the confusion. So there are two issues so far ~
record: taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl
This record should have $20401 AMT liability, but Taxsim is showing zero for the AMT output.
Taxsim output: income tax $ 213264.5. payroll tax: $27343.59. AGI: $762930.7
example record: taxsimid 222 year 2021 state mstat 2 page 75 sage 74 depx 3 dep13 3 dep17 3 dep18 3 pwages 14000 swages 20000 psemp 278 ssemp 281 dividends 18000 intrec 5000 stcg 0 ltcg -2000 otherprop 3000 nonprop 26000 pensions 16000 gssi 16000 pui 10000 sui 7000 transfers 0 rentpaid 0 proptax 6000 otheritem 10000 childcare 4000 mortgage 39000 scorp 165000 pbusinc 121000 pprofinc 0 sbusinc 114000 sprofinc
The non_refundable_child_odep_credit should be $250, by my manual calculation following form 1040 schdule 8812. Tax-Calculator result is $274.14; Taxsim result is $3.17
The result I got from taxsim of this record is: income tax $95709.64. payroll tax $27665.4. AGI $ 519936.6
On Mon, 25 Dec 2023, Bodi Yang wrote: My manual calculation can be found in [the attached picture zip file in my previous comment](#2705 (comment)) At that page I see highlighted a link to a for 8812 that is not relevant. Daniel Feenberg 617-682-6204 … Best, Bodi -- Reply to this email directly or view it on GitHub: #2705 (comment) You are receiving this because you commented. Message ID: @.***>
Oh I see, we probably end up talking about different issues in this PR. Sorry about the confusion. So there are two issues so far ~
- I posted the issue of AMT in this comment
record: taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl
This record should have $20401 AMT liability, but Taxsim is showing zero for the AMT output.
Taxsim output: income tax $ 213264.5. payroll tax: $27343.59. AGI: $762930.7
- And another issue of child tax credit in another comment here
example record: taxsimid 222 year 2021 state mstat 2 page 75 sage 74 depx 3 dep13 3 dep17 3 dep18 3 pwages 14000 swages 20000 psemp 278 ssemp 281 dividends 18000 intrec 5000 stcg 0 ltcg -2000 otherprop 3000 nonprop 26000 pensions 16000 gssi 16000 pui 10000 sui 7000 transfers 0 rentpaid 0 proptax 6000 otheritem 10000 childcare 4000 mortgage 39000 scorp 165000 pbusinc 121000 pprofinc 0 sbusinc 114000 sprofinc
The non_refundable_child_odep_credit should be $250, by my manual calculation following form 1040 schdule 8812. Tax-Calculator result is $274.14; Taxsim result is $3.17
The result I got from taxsim of this record is: income tax $95709.64. payroll tax $27665.4. AGI $ 519936.6
I may send my manual calculation of the AMT issue later. I'm traveling and left my manual calculation draft in office. Will get back next week.
I am trying to work on the AMT issue. If I select comment 2705 it goes to a thread with a score of links. I can't find any that provide the manual calculation of the AMT example. It doesn't do any good to keep referring me to that thread, unless you believe I am missing a relevant link, and can provide more information to me about which link is relevant. Or you could just attach the manual calculation to the email.
Thank you Daniel Feenberg 617-682-6204
On Mon, 25 Dec 2023, Bodi Yang wrote:
On Mon, 25 Dec 2023, Bodi Yang wrote: My manual calculation can be found in [the attached picture zip file in my previous comment](#2705 (comment)) At that page I see highlighted a link to a for 8812 that is not relevant. Daniel Feenberg 617-682-6204 ? Best, Bodi -- Reply to this email directly or view it on GitHub: #2705 (comment) You are receiving this because you commented. Message ID: @.***>
Oh I see, we probably end up talking about different issues in this PR. Sorry about the confusion. So there are two issues so far ~
- I posted the issue of AMT in this comment
record: taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl
This record should have $20401 AMT liability, but Taxsim is showing zero for the AMT output.
Taxsim output: income tax $ 213264.5. payroll tax: $27343.59. AGI: $762930.7
- And another issue of child tax credit in another comment here
example record: taxsimid 222 year 2021 state mstat 2 page 75 sage 74 depx 3 dep13 3 dep17 3 dep18 3 pwages 14000 swages 20000 psemp 278 ssemp 281 dividends 18000 intrec 5000 stcg 0 ltcg -2000 otherprop 3000 nonprop 26000 pensions 16000 gssi 16000 pui 10000 sui 7000 transfers 0 rentpaid 0 proptax 6000 otheritem 10000 childcare 4000 mortgage 39000 scorp 165000 pbusinc 121000 pprofinc 0 sbusinc 114000 sprofinc
The non_refundable_child_odep_credit should be $250, by my manual calculation following form 1040 schdule 8812. Tax-Calculator result is $274.14; Taxsim result is $3.17
The result I got from taxsim of this record is: income tax $95709.64. payroll tax $27665.4. AGI $ 519936.6
-- Reply to this email directly or view it on GitHub: https://github.com/PSLmodels/Tax-Calculator/pull/2705#issuecomment-1869176520 You are receiving this because you commented.
Message ID: @.***>
Oh, I see, there isn't a manual calculation for the AMT yet. I missed that. I'll put off working on this then.
Sorry Daniel Feenberg 617-682-6204
On Mon, 25 Dec 2023, Bodi Yang wrote:
On Mon, 25 Dec 2023, Bodi Yang wrote: My manual calculation can be found in [the attached picture zip file in my previous comment](#2705 (comment)) At that page I see highlighted a link to a for 8812 that is not relevant. Daniel Feenberg 617-682-6204 ? Best, Bodi -- Reply to this email directly or view it on GitHub: #2705 (comment) You are receiving this because you commented. Message ID: @.***>
Oh I see, we probably end up talking about different issues in this PR. Sorry about the confusion. So there are two issues so far ~
- I posted the issue of AMT in this comment
record: taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl
This record should have $20401 AMT liability, but Taxsim is showing zero for the AMT output.
Taxsim output: income tax $ 213264.5. payroll tax: $27343.59. AGI: $762930.7
- And another issue of child tax credit in another comment here
example record: taxsimid 222 year 2021 state mstat 2 page 75 sage 74 depx 3 dep13 3 dep17 3 dep18 3 pwages 14000 swages 20000 psemp 278 ssemp 281 dividends 18000 intrec 5000 stcg 0 ltcg -2000 otherprop 3000 nonprop 26000 pensions 16000 gssi 16000 pui 10000 sui 7000 transfers 0 rentpaid 0 proptax 6000 otheritem 10000 childcare 4000 mortgage 39000 scorp 165000 pbusinc 121000 pprofinc 0 sbusinc 114000 sprofinc
The non_refundable_child_odep_credit should be $250, by my manual calculation following form 1040 schdule 8812. Tax-Calculator result is $274.14; Taxsim result is $3.17
The result I got from taxsim of this record is: income tax $95709.64. payroll tax $27665.4. AGI $ 519936.6
I may send my manual calculation of the AMT issue later. I'm traveling and left my manual calculation draft in office. Will get back next week.
-- Reply to this email directly or view it on GitHub: https://github.com/PSLmodels/Tax-Calculator/pull/2705#issuecomment-1869177703 You are receiving this because you commented.
Message ID: @.***>
Oh, I see, there isn't a manual calculation for the AMT yet. I missed that. I'll put off working on this then. Sorry Daniel Feenberg 617-682-6204 … On Mon, 25 Dec 2023, Bodi Yang wrote: >> On Mon, 25 Dec 2023, Bodi Yang wrote: My manual calculation can be found in [the attached picture zip file in my previous comment]([#2705 (comment)](#2705 (comment))) >> At that page I see highlighted a link to a for 8812 that is not relevant. Daniel Feenberg 617-682-6204 >> ? >> Best, Bodi -- Reply to this email directly or view it on GitHub: [#2705 (comment)](#2705 (comment)) You are receiving this because you commented. Message ID: @.> > > Oh I see, we probably end up talking about different issues in this PR. Sorry about the confusion. So there are two issues so far ~ > > 1. I posted the issue of AMT [in this comment](#2705 (comment)) > > record: taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl > > This record should have $20401 AMT liability, but Taxsim is showing zero for the AMT output. > > Taxsim output: income tax $ 213264.5. payroll tax: $27343.59. AGI: $762930.7 > > 2. And another issue of child tax credit [ in another comment here](#2705 (comment)) > > example record: taxsimid 222 year 2021 state mstat 2 page 75 sage 74 depx 3 dep13 3 dep17 3 dep18 3 pwages 14000 swages 20000 psemp 278 ssemp 281 dividends 18000 intrec 5000 stcg 0 ltcg -2000 otherprop 3000 nonprop 26000 pensions 16000 gssi 16000 pui 10000 sui 7000 transfers 0 rentpaid 0 proptax 6000 otheritem 10000 childcare 4000 mortgage 39000 scorp 165000 pbusinc 121000 pprofinc 0 sbusinc 114000 sprofinc > > The non_refundable_child_odep_credit should be $250, by my manual calculation following form 1040 schdule 8812. Tax-Calculator result is $274.14; Taxsim result is $3.17 > > The result I got from taxsim of this record is: income tax $95709.64. payroll tax $27665.4. AGI $ 519936.6 I may send my manual calculation of the AMT issue later. I'm traveling and left my manual calculation draft in office. Will get back next week. -- Reply to this email directly or view it on GitHub: #2705 (comment) You are receiving this because you commented. Message ID: @.>
Hi Daniel, I've attached the manual calculation of the AMT issue record in this file: AMT record.zip The manual calculation follows form 6251 of the year 2021
note: line 4 of the form, Alternative minimum taxable income $762940; and line 10 of the form, Form 1040 or 1040-SR line 16 ... $183930 are intermediate variables read from output of Tax-Calculator (These two intermediate variables' result from Taxsim are: AMT taxable income $700942; line 16 of form 1040 is $214387)
record input: taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl
This record should have $20401 AMT liability, but Taxsim is showing zero for the AMT output.
Taxsim output: income tax $ 213264.5. payroll tax: $27343.59. AGI: $762930.7
Can you send the 1040, Qualified Dividens and Capital Gain Tax worksheet and Schedule D itself also? I need to be able to put the taxpayer into TaxAct and see what it calculates and I am having trouble getting TaxAct to generate the numbers for line13, 20 and 27 of form 6251.
Thanks Daniel Feenberg +1 617-682-6204
On 1/2/24, Bodi Yang @.***> wrote:
Oh, I see, there isn't a manual calculation for the AMT yet. I missed that. I'll put off working on this then. Sorry Daniel Feenberg 617-682-6204 … On Mon, 25 Dec 2023, Bodi Yang wrote: >> On Mon, 25 Dec 2023, Bodi Yang wrote: My manual calculation can be found in [the attached picture zip file in my previous comment](#2705 (comment))
At that page I see highlighted a link to a for 8812 that is not relevant. Daniel Feenberg 617-682-6204 >> ? >> Best, Bodi -- Reply to this email directly or view it on GitHub: #2705 (comment) You are receiving this because you commented. Message ID: @.> > > Oh I see, we probably end up talking about different issues in this PR. Sorry about the confusion. So there are two issues so far ~ > > 1. I posted the issue of AMT in this comment record: taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl > > This record should have $20401 AMT liability, but Taxsim is showing zero for the AMT output. > > Taxsim output: income tax $ 213264.5. payroll tax: $27343.59. AGI: $762930.7 > > 2. And another issue of child tax credit in another comment here example record: taxsimid 222 year 2021 state mstat 2 page 75 sage 74 depx 3 dep13 3 dep17 3 dep18 3 pwages 14000 swages 20000 psemp 278 ssemp 281 dividends 18000 intrec 5000 stcg 0 ltcg -2000 otherprop 3000 nonprop 26000 pensions 16000 gssi 16000 pui 10000 sui 7000 transfers 0 rentpaid 0 proptax 6000 otheritem 10000 childcare 4000 mortgage 39000 scorp 165000 pbusinc 121000 pprofinc 0 sbusinc 114000 sprofinc > > The non_refundable_child_odep_credit should be $250, by my manual calculation following form 1040 schdule 8812. Tax-Calculator result is $274.14; Taxsim result is $3.17 > > The result I got from taxsim of this record is: income tax $95709.64. payroll tax $27665.4. AGI $ 519936.6 I may send my manual calculation of the AMT issue later. I'm traveling and left my manual calculation draft in office. Will get back next week. -- Reply to this email directly or view it on GitHub: #2705 (comment) You are receiving this because you commented. Message ID: @.>
Hi Daniel, I've attached the manual calculation of the AMT issue record in this file: AMT record.zip The manual calculation follows form 6251 of the year 2021
note: line 4 of the form, Alternative minimum taxable income $762940; and line 10 of the form, Form 1040 or 1040-SR line 16 ... $183930 are intermediate variables read from output of Tax-Calculator (These two intermediate variables' result from Taxsim are: AMT taxable income $700942; line 16 of form 1040 is $214387)
record input: taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl
This record should have $20401 AMT liability, but Taxsim is showing zero for the AMT output.
Taxsim output: income tax $ 213264.5. payroll tax: $27343.59. AGI: $762930.7
-- Reply to this email directly or view it on GitHub: https://github.com/PSLmodels/Tax-Calculator/pull/2705#issuecomment-1874221082 You are receiving this because you commented.
Message ID: @.***>
Can you send the 1040, Qualified Dividens and Capital Gain Tax worksheet and Schedule D itself also? I need to be able to put the taxpayer into TaxAct and see what it calculates and I am having trouble getting TaxAct to generate the numbers for line13, 20 and 27 of form 6251. Thanks Daniel Feenberg +1 617-682-6204 … On 1/2/24, Bodi Yang @.> wrote: > Oh, I see, there isn't a manual calculation for the AMT yet. I missed > that. I'll put off working on this then. Sorry Daniel Feenberg > 617-682-6204 > … > On Mon, 25 Dec 2023, Bodi Yang wrote: >> On Mon, 25 Dec 2023, Bodi Yang > wrote: My manual calculation can be found in [the attached picture zip > file in my previous comment]([#2705 (comment)]([#2705 > (comment)](#2705 (comment)))) > >> At that page I see highlighted a link to a for 8812 that is not > relevant. Daniel Feenberg 617-682-6204 >> ? >> Best, Bodi -- Reply to > this email directly or view it on GitHub: [#2705 (comment)]([#2705 > (comment)](#2705 (comment))) > You are receiving this because you commented. Message ID: @.> > > > Oh I see, we probably end up talking about different issues in this PR. > Sorry about the confusion. So there are two issues so far ~ > > 1. I > posted the issue of AMT [in this comment]([#2705 > (comment)](#2705 (comment))) > > > record: taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 > dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec > 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi > 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare > mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl > > > This record should have $20401 AMT liability, but Taxsim is showing zero > for the AMT output. > > Taxsim output: income tax $ 213264.5. payroll tax: > $27343.59. AGI: $762930.7 > > 2. And another issue of child tax credit > [ in another comment here]([#2705 > (comment)](#2705 (comment))) > > > example record: taxsimid 222 year 2021 state mstat 2 page 75 sage 74 > depx 3 dep13 3 dep17 3 dep18 3 pwages 14000 swages 20000 psemp 278 ssemp > 281 dividends 18000 intrec 5000 stcg 0 ltcg -2000 otherprop 3000 nonprop > 26000 pensions 16000 gssi 16000 pui 10000 sui 7000 transfers 0 rentpaid 0 > proptax 6000 otheritem 10000 childcare 4000 mortgage 39000 scorp 165000 > pbusinc 121000 pprofinc 0 sbusinc 114000 sprofinc > > The > non_refundable_child_odep_credit should be $250, by my manual calculation > following form 1040 schdule 8812. Tax-Calculator result is $274.14; Taxsim > result is $3.17 > > The result I got from taxsim of this record is: income > tax $95709.64. payroll tax $27665.4. AGI $ 519936.6 I may send my manual > calculation of the AMT issue later. I'm traveling and left my manual > calculation draft in office. Will get back next week. -- Reply to this > email directly or view it on GitHub: [#2705 > (comment)](#2705 (comment)) > You are receiving this because you commented. Message ID: @.> Hi Daniel, I've attached the manual calculation of the AMT issue record in this file: AMT record.zip The manual calculation follows form 6251 of the year 2021 note: line 4 of the form, Alternative minimum taxable income $762940; and line 10 of the form, Form 1040 or 1040-SR line 16 ... $183930 are intermediate variables read from output of Tax-Calculator (These two intermediate variables' result from Taxsim are: AMT taxable income $700942; line 16 of form 1040 is $214387) record input: taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl This record should have $20401 AMT liability, but Taxsim is showing zero for the AMT output. Taxsim output: income tax $ 213264.5. payroll tax: $27343.59. AGI: $762930.7 -- Reply to this email directly or view it on GitHub: #2705 (comment) You are receiving this because you commented. Message ID: @.>
I've attached the Qualified Dividends and Capital Gain Tax Worksheet and form 1040 Sch D ~ I only completed the lines which is related
When filling Form 6251 line 13 of Form 6251 = line 4 of Qualified Dividends and Capital Gain Tax Worksheet = 18000 line 20 of Form 6251 = line 5 of Qualified Dividends and Capital Gain Tax Worksheet = 589811 line 27 of Form 6251 = line 5 of Qualified Dividends and Capital Gain Tax Worksheet = 589811
Note: line 1 of the Qualified Dividends and Capital Gain Tax Worksheet is the taxable income Form 1040 line 15, which is read from the Tax-Calculator output $607811 (taxable income from Taxsim35 is $680442)
1) Maybe I am not entering the data correctly. Attached is taxsim output showing AGI of 762,817, which is suspiciously close to your 762,940 for taxable income on the 6251. But I see a QBI deduction of 134,600, which means taxable income should be much less and significantly lowers the AMT.
2) Are you using the latest version of taxsim? Online it is at
http://taxsim.nber.org/taxsimtest
and I have attached fortran source code. Actually, I can see you are using taxsim35, while I am trying to get taxsimtest ready to make the production version. It is really important that you test against the new version.
3) I am still concerned that the numbers you gave me can not be the numbers used by taxsim, since you specified mstat==1 and then have spouse UI. I don't understand why you are so reluctant to show me your work. It would clarify things if I had the 1040, or at least the data from that page. Can your software print out an observation? That might be enough.
4) Something about your mail client Daniel Feenberg +1 617-682-6204
On Fri, 5 Jan 2024, Bodi Yang wrote:
Can you send the 1040, Qualified Dividens and Capital Gain Tax worksheet and Schedule D itself also? I need to be able to put the taxpayer into TaxAct and see what it calculates and I am having trouble getting TaxAct to generate the numbers for line13, 20 and 27 of form 6251. Thanks Daniel Feenberg +1 617-682-6204 ? On 1/2/24, Bodi Yang @.> wrote: > Oh, I see, there isn't a manual calculation for the AMT yet. I missed > that. I'll put off working on this then. Sorry Daniel Feenberg > 617-682-6204 > ? > On Mon, 25 Dec 2023, Bodi Yang wrote: >> On Mon, 25 Dec 2023, Bodi Yang > wrote: My manual calculation can be found in [the attached picture zip > file in my previous comment]([#2705 (comment)]([#2705 > (comment)](#2705 (comment)))) > >> At that page I see highlighted a link to a for 8812 that is not > relevant. Daniel Feenberg 617-682-6204 >> ? >> Best, Bodi -- Reply to > this email directly or view it on GitHub: [#2705 (comment)]([#2705 > (comment)](#2705 (comment))) > You are receiving this because you commented. Message ID: @.> > > > Oh I see, we probably end up talking about different issues in! this PR. > Sorry about the confusion. So there are two issues so far ~ > > 1. I > posted the issue of AMT [in this comment]([#2705 > (comment)](#2705 (comment))) > > > record: taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 > dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec > 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi > 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare > mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl > > > This record should have $20401 AMT liability, but Taxsim is showing zero > for the AMT output. > > Taxsim output: income tax $ 213264.5. payroll tax: > $27343.59. AGI: $762930.7 > > 2. And another issue of child tax credit > [ in another comment here]([#2705 > (comment)](#2705 (comment))) > > > example record: taxsimid 222 year 2021 state mstat 2 page 75 sage 74 > depx 3 dep13 3 dep17 3 dep18 3 pwages 14000 swages 20000 psemp 278 ssemp > 281 dividends 18000 intrec 5000 stcg 0 ltcg -2000 otherprop 3000 nonprop > 26000 pensions 16000 gssi 16000 pui 10000 sui 7000 transfers 0 rentpaid 0 > proptax 6000 otheritem 10000 childcare 4000 mortgage 39000 scorp 165000 > pbusinc 121000 pprofinc 0 sbusinc 114000 sprofinc > > The > non_refundable_child_odep_credit should be $250, by my manual calculation > following form 1040 schdule 8812. Tax-Calculator result is $274.14; Taxsim > result is $3.17 > > The result I got from taxsim of this record is: income > tax $95709.64. payroll tax $27665.4. AGI $ 519936.6 I may send my manual > calculation of the AMT issue later. I'm traveling and left my manual > calculation draft in office. Will get back next week. -- Reply to this > email directly or view it on GitHub: [#2705 > (comment)](#2705 (comment)) > You a! re receiving this because you commented. Message ID: @.> Hi Daniel, I've attached the manual calculation of the AMT issue record in this file: AMT record.zip The manual calculation follows form 6251 of the year 2021 note: line 4 of the form, Alternative minimum taxable income $762940; and line 10 of the form, Form 1040 or 1040-SR line 16 ... $183930 are intermediate variables read from output of Tax-Calculator (These two intermediate variables' result from Taxsim are: AMT taxable income $700942; line 16 of form 1040 is $214387) record input: taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc! idtl This record should have $20401 AMT liability, but Taxsim is showing zero for the AMT output. Taxsim output: income tax $ 213264.5. payroll tax: $27343.59. AGI: $762930.7 -- Reply to this email directly or view it on GitHub: #2705 (comment) You are receiving this because you commented. Message ID: @.>
I've attached the Qualified Dividends and Capital Gain Tax Worksheet and form 1040 Sch D ~ I only completed the lines which is related
When filling Form 6251 line 13 of Form 6251 = line 4 of Qualified Dividends and Capital Gain Tax Worksheet = 18000 line 20 of Form 6251 = line 5 of Qualified Dividends and Capital Gain Tax Worksheet = 589811 line 27 of Form 6251 = line 5 of Qualified Dividends and Capital Gain Tax Worksheet = 589811
Note: line 1 of the Qualified Dividends and Capital Gain Tax Worksheet is the taxable income Form 1040 line 15, which is read from the Tax-Calculator output $607811 (taxable income from Taxsim35 is $680442)
-- Reply to this email directly or view it on GitHub: https://github.com/PSLmodels/Tax-Calculator/pull/2705#issuecomment-1878962626 You are receiving this because you commented.
Message ID: @.***> NBER TAXSIM (Compiled 20240104) With TCJA State law coded through 2022 Later state laws extrapolated from that year. Marginal tax rate wrt taxpayer earnings.
Input Data:
Dependent Exemptions: 5.00 Dependent Ages 0.00 0.00 0.00 8-10. #deps for CCC/CTC/EIC: 5.00 5.00 5.00 11-12. Wages (Txpyr/Spouse): 2000.00 0.00 11a12a Self-employment income: 147.00 0.00
Basic Output:
Federal Tax Calculation: Base +$1
FICA 26543.56 26543.65 Taxpayer share of FICA 26390.56 26390.58
TCJA 2018+
QBI Deduction 134600.00 134600.00
Additional Medicare Taxes 2013+
Medicare Tax on Earnings 1126.32 1126.33
Decomposition of Federal Marginal Rate (taxpayer earned income)
Regular Income Tax Bracket rate from X,Y or Z 42.00 Deduction Phaseout: 0.00 Exemption Phaseout: 0.00 Social Security Phasein: 0.00 Child Tax Credit: 0.00 Child Care Credit: 0.00 Refundable Part of CTC: 0.00 Earned Income Credit: 0.00 Surtax on 15% bracket: 0.00 Exemption Surtax: 0.00 Unemployment Insurance: 0.00 Max Tax on Earned Income: 18000.00 Elderly Credit: 0.00 Dependent Care Credit: 0.00 Percentage Std Deduction: 0.00 Medicare tax on Unearned Inco 0.00 Cares Recovery Rebates: 0.00
Alternative Minimum Income Tax
AMT Bracket Rate 28.00
AMT Phaseout -28.00
Only Regular Tax Relevant Total Marginal Rate: 42.00 FICA w Medicare (t,s): 0.00 0.00
c This is the fixed format Fortran-90 source code for TAXSIM c as compiled 20240105. It is copyright 2023 by NBER and c Daniel Feenberg. Please do not pass along to other users. c Refer potential users to @.*** for their own c copy.
c Documentation is at http://taxsim.nber.org
c Bug reports and suggestions for improvement are always welcome.
c Thank you
c Daniel Feenberg c +1 617-617-682-6204 c @.***
block data mrhb
common/mrhc/mrh
data mrh/1/
end
double precision function rup(a,h)
c a=value to round up to a multiple of h and non-negative implicit double precision (a-h,o-z) common /psubr/ xndx,amtpi,almnpx,egtrra,almzbr,almst,enders, &gjtrra,ratmul,cgmul,amtmul,tipra,wilhlc,extnd(0:100) extnd(88)=1.d0 if(extnd(88).eq.0.d0) then rup=max(a,0.d0) else rup=max(0.d0,ceiling(a/h)*h) endif return end
double precision function sern(d)
implicit double precision(a-h,o-z)
dimension d(255)
if(d(2).eq.2.and.d(85)+d(86).gt.0.d0) then
sern=min(d(85),d(86))
else
sern=d(11)
endif
return
end
integer function itwn(i,imin,imax)
itwn=min(imax,max(i,imin))
return
end
subroutine statax(data,lawyr,comnew)
implicit double precision (A-H,O-Z)
parameter(lastat=2022)
common /psubr/ xndx,amtpi,almnpx,egtrra,almzbr,almst,enders,
&gjtrra,ratmul,cgmul,amtmul,tipra,wilhlc,extnd(0:100)
common/calc/hy,rent,agi,exemp,stded,xitded,taxinc,pcred,chcr,
& earncr,credit,rt,taxbc,rebate,energy,ctc,ylow,amt
common /xndxac/ xndxa(1981:2023)
dimension data(255),comnew(255)
dimension ds(255),coms(255)
c DO NOT FORGET TO UPDATE parameter(lastat) EVERY YEAR
agi=0.
exemp =0.
stded =0.
xitded=0.
taxinc=0.
pcred =0.
chcr =0.
earncr=0.
credit=0.
rt =0.
taxbc =0.
rebate=0.
energy=0.
ctc =0.
ylow =0.
amt =0.
stax=0.
rt=0.
hy=data(159)
rent=data(160)
comnew(74)=0.
id=int(abs(data(6)))
if(lawyr.eq.-99) then
lawyr=lastat
return
endif
if(lawyr.lt.1977) then
write(*,*)
& 'TAXSIM: State Tax Calculator available for years 1977+'
return
endif
if(id.le.0.or.id.gt.51) return
flate = 1.
law = lawyr
if(extnd(21).gt.0) law = int(extnd(21))
if(law.gt.lastat) then
flate = xndxa(law)/xndxa(lastat)
law = lastat
endif
do 100 i=1,255
ds(i) = data(i)
coms(i) = comnew(i)
100 continue
do 200 i=11,99
ds(i) = data(i)/flate
ds(i+100) = data(i+100)/flate
200 continue
do 300 i=1,98
if(i.ne.26.and.i.ne.65.and.i.ne.72.and.i.ne.73)
& coms(i) = comnew(i)/flate
300 continue
i=int(data(6))
select case(i)
case(1)
call altax(ds,coms,stax,law)
case(2)
call aktax(ds,coms,stax,law)
case(3)
call aztax(ds,coms,stax,law)
case(4)
call artax(ds,coms,stax,law)
case(5)
call catax(ds,coms,stax,law)
case(6)
call cotax(ds,coms,stax,law)
case(7)
call cttax(ds,coms,stax,law)
case(8)
call detax(ds,coms,stax,law)
case(9)
call dctax(ds,coms,stax,law)
case(11)
call gatax(ds,coms,stax,law)
case(12)
call hitax(ds,coms,stax,law)
case(13)
call idtax(ds,coms,stax,law)
case(14)
call iltax(ds,coms,stax,law)
case(15)
call intax(ds,coms,stax,law)
case(16)
call iatax(ds,coms,stax,law)
case(17)
call kstax(ds,coms,stax,law)
case(18)
call kytax(ds,coms,stax,law)
case(19)
call latax(ds,coms,stax,law)
case(20)
call metax(ds,coms,stax,law)
case(21)
call mdtax(ds,coms,stax,law)
case(22)
call matax(ds,coms,stax,law)
case(23)
call mitax(ds,coms,stax,law)
case(24)
call mntax(ds,coms,stax,law)
case(25)
call mstax(ds,coms,stax,law)
case(26)
call motax(ds,coms,stax,law)
case(27)
call mttax(ds,coms,stax,law)
case(28)
call netax(ds,coms,stax,law)
case(30)
call nhtax(ds,coms,stax,law)
case(31)
call njtax(ds,coms,stax,law)
case(32)
call nmtax(ds,coms,stax,law)
case(33)
call nytax(ds,coms,stax,law)
case(34)
call nctax(ds,coms,stax,law)
case(35)
call ndtax(ds,coms,stax,law)
case(36)
call ohtax(ds,coms,stax,law)
case(37)
call oktax(ds,coms,stax,law)
case(38)
call ortax(ds,coms,stax,law)
case(39)
call patax(ds,coms,stax,law)
case(40)
call ritax(ds,coms,stax,law)
case(41)
call sctax(ds,coms,stax,law)
case(43)
call tntax(ds,coms,stax,law)
case(45)
call uttax(ds,coms,stax,law)
case(46)
call vttax(ds,coms,stax,law)
case(47)
call vatax(ds,coms,stax,law)
case(49)
call wvtax(ds,coms,stax,law)
case(50)
call witax(ds,coms,stax,law)
case default
stax=0.d0
end select
comnew(74) = stax*flate
return
end
c
c Subroutines from Statutil
c
recursive double precision function socsec(data,comnew,law)
implicit double precision (A-H,O-Z)
dimension data(255),comnew(255),rate(1977:2025),ceil(1977:2029)
data rate
171300.d0,177300.d0,183600.d0,190200.d0/
c actual amounts through 2022 (03.21.2022)
mst = int(data(2))
if(mst.eq.2) then
fica = (min(data(85),ceil(law))+min(data(86),ceil(law)))
& rate(law)
if(data(85).gt.ceil(law))
& fica = fica + (data(85)-ceil(law)).0145
if(data(86).gt.ceil(law))
& fica = fica + (data(86)-ceil(law)).0145
else
fica = min(data(11),ceil(law))rate(law)
if(data(11).gt.ceil(law))
& fica = fica + (data(11)-ceil(law))*.0145
endif
c socsec = fica + data(43)+data(44)
c c175 = setax in sstax
socsec = fica + comnew(175)+data(44)
c Additional 0.9% Medicare Tax on Earned Income
if(law.ge.2013) socsec = socsec + comnew(180)
return
end
double precision function xjobs(data,law)
implicit double precision (A-H,O-Z)
dimension data(255),rate1(1977:1994),rate2(1977:1994)
data rate1/10.5d0,3.4d0,50.0d0/
data rate2/10.25d0,80.0d0/
amt1=0.
amt2=0.
xjobs=0.
if(law.le.1986) then
amt1=data(37)2/3
amt2=amt1/2
xjobs=min(12000.0d0,(amt1/rate1(law))+(amt2/rate2(law)))
elseif(law.ge.1987.and.law.le.1989) then
amt1=data(37)
amt2=0.
xjobs=min(6000.0d0,(amt1/rate1(law)))
elseif(law.ge.1990) then
xjobs=0.
endif
return
end
c
recursivesubroutine look(table,y,ntab,n,statax,aif,data2,rt,data) implicit double precision (A-H,O-Z) common/times/z,p,txrate,h dimension table(2,ntab),data(255) integer d2,d209 d209 = int(data(209)) d2 = int(data2) c negative data2 is signal that separate filing is allowed. h=0. c ntab=25 call look2(table,y,ntab,n,statax,aif,dabs(data2),rt,data) if(d2.eq.-2) then yh= max(data(85),data(86))+(y-data(11))/2. yw=y-yh h=2 call look2(table,yw,ntab,n,taxw,aif,1.0d0,rt,data) h=1 call look2(table,yh,ntab,n,taxh,aif,1.0d0,rt,data) if(taxw+taxh.gt.statax.and.d209.eq.2) then continue endif statax=min(statax,taxw+taxh) endif return end
subroutine look2(table,y,ntab,n,statax,aif,data2,rt,data) implicit double precision (A-H,O-Z) c aif=annual inflation factor if indexed,otherwise 1. common/times/z,p,txrate,h c data2=marital status if joint filing is allowed,otherwise 0. dimension table(2,ntab),data(255) integer d2 d2 = int(data2) c This line is in here to avoid unused variable errors n = n ajnt=1. if(d2.eq.2.or.d2.eq.5)ajnt=2 y1=max(y/aif/ajnt,0.0d0) statax=0. rt=0. yleft=y1 rate=table(2,1)/100. if(y1.lt.table(1,1)) goto 99 statax=table(1,1)table(2,1)/100. do 10 i=2,ntab if(table(1,i).lt.table(1,i-1).or.table(2,i).lt..1) then if(table(2,i).gt.0) then d101 = data(101) d100 = data(100) c write(,) 'TAXSIM:in look2', c & table(1,i),table(1,i-1),table(2,i),d101,data(6),d100 endif endif yleft=y1-table(1,i-1) rate=table(2,i)/100. if(y1.lt.table(1,i)) goto 99 statax=statax+(table(1,i)-table(1,i-1))rate 10 continue yleft=y1-table(1,ntab) 99 continue statax=aifajnt(yleft*rate+statax) c calculating marginal tax rate rt=rate return end
subroutine badlook2(table,y,ntab,n,statax,aif,data2,rt,data)
implicit double precision (A-H,O-Z)
c aif=annual inflation factor if indexed,otherwise 1.
common/times/z,p,txrate,h
common/xcom/x(48)
c data2=marital status if income splitting is allowed,otherwise 0.
dimension table(2,ntab),data(255)
integer d2
d2 = int(data2)
c This line is in here to avoid unused variable errors
n = n
ajnt=1.
if(d2.eq.2.or.d2.eq.5)ajnt=2
y1=max(y/aif/ajnt,0.0d0)
if(x(3).gt.0.and.x(1).lt.-2)
& write(,)'y,aif,y1',int(y),sngl(aif),int(y1),int(ajnt)
statax=0.
rt=0.
yleft=y1
rate=table(2,1)/100.
if(y1.lt.table(1,1)) goto 99
statax=table(1,1)table(2,1)/100.
do 10 i=2,ntab
if(table(1,i).lt.table(1,i-1).or.table(2,i).lt..1) then
if(table(2,i).gt.0) then
d101 = data(101)
d100 = data(100)
write(,) 'TAXSIM: in look2',
& table(1,i),table(1,i-1),table(2,i),d101,data(6),d100
endif
endif
yleft=y1-table(1,i-1)
rate=table(2,i)/100.
if(y1.lt.table(1,i)) goto 99
statax=statax+(table(1,i)-table(1,i-1))rate
incr=int((table(1,i)-table(1,i-1))rate)
if(x(3).gt.0..and.x(1).lt.-1)
& write(,)'i rs',int(table(1,i)),'-',
& int(table(1,i-1)),''
& ,rate,incr,int(statax)
10 continue
yleft=y1-table(1,ntab)
if(data(6).ne.28) then
write(,)'TAXSIM: never here'
write(,) n,ntab,aif,table
call backtrace()
stop 10
endif
99 continue
if(x(3).gt.0.and.x(1).lt.-1)
& write(,)'rs ',yleft,'',rate,'= ',yleftrate
& ,'already',table(1,ntab)
statax=aifajnt(yleftrate+statax)
if(x(3).gt.0.and.x(1).lt.-1) then
write(,*)'sum',int(statax)
endif
c calculating marginal tax rate
rt=rate
return
end
subroutine tplus(table,y,ntab,n,statax,aif,data2,rt,data)
implicit double precision (A-H,O-Z)
c aif=annual inflation factor if indexed,otherwise 1.
common/times/z,p,txrate,h
common/x/ct
c data2=marital status if income splitting is allowed,otherwise 0.
dimension table(3,ntab),data(255)
integer d2
c These lines are in here to avoid unused variable errors
d2 = int(data2)
dummy=data(1)
n = n
ii=1
ajnt=1.
if(d2.eq.2.or.d2.eq.5)ajnt=2
y1=max(y/aif/ajnt,0.0d0)
statax=0.
rt=0.
if(y1.lt.table(1,1)) then
statax=aifajnttable(2,1)y1/100.d0
else
do 10 i=2,ntab
ii=i
if(y1.lt.table(1,i)) exit
10 continue
yleft=y1-table(1,ii-1)
statax=table(3,ii)
statax=statax+table(2,ii)yleft/100.d0
statax=aifajntstatax
endif
c calculating marginal tax rate
rate=table(2,ii)/100.d0
rt=rate
c2 format(a8,3f8.2,f6.0,f4.0,f12.0)
return
end
double precision function disap(y,alow,ahigh)
implicit double precision (A-H,O-Z)
if(ahigh.le.alow) then
write(,) 'TAXSIM:never,in disap',alow,ahigh
continue
endif
disap=1.-min(max(((y-alow)/ahigh-alow),0.0d0),1.0d0)
return
end
double precision function xif(logic,real)
implicit double precision (A-H,O-Z)
logical logic
xif=0.
if(logic) xif=real
return
end
double precision function tablk(table,n,y,data)
implicit double precision (A-H,O-Z)
dimension table(2,n),data(255)
do 200 j=1,n
num=j
if(j+1.ge.n) goto 2
if(table(1,j+1).le.table(1,j)) then
write(,)'TAXSIM: tablk',table(1,j),table(1,j+1)
write(,)'law,state',int(data(6)),int(data(101)),
& int(data(100))
write(,)'table',(table(2,k),k=1,n)
call backtrace()
stop 100
endif
2 if(y.lt.table(1,j)) go to 210
200 continue
tablk=0.
210 tablk=table(2,num)
return
end
double precision function tablki(table,n,y,data)
implicit double precision (A-H,O-Z)
common /psubr/ xndx,amtpi,almnpx,egtrra,almzbr,almst,enders,
&gjtrra,ratmul,cgmul,amtmul,tipra,wilhlc,extnd(0:100)
dimension table(2,n),data(255)
do 200 j=1,n
num=j
if(j+1.ge.n) goto 2
if(table(1,j+1).le.table(1,j)) then
write(,) 'TAXSIM: in tablki',
& table(1,j),table(1,j+1),data(6)
call abort()
endif
2 if(y.lt.table(1,j)) go to 210
200 continue
w=-1.d0
210 continue
if(num.eq.1) then
tablki = table(2,num)
else if(num.lt.n) then
w = (y-table(1,num-1))/(table(1,num)-table(1,num-1))
if(table(2,num).gt.table(2,num-1)) then
tablki = wtable(2,num-1) + (1-w)table(2,num)
else
tablki = wtable(2,num) + (1-w)table(2,num-1)
endif
else if(num.eq.n) then
tablki=table(2,num)
endif
if(extnd(88).gt.0.d0) tablki = table(2,num)
return
end
double precision function tablk2(table,n,y,data)
implicit double precision (A-H,O-Z)
common /psubr/ xndx,amtpi,almnpx,egtrra,almzbr,almst,enders,
&gjtrra,ratmul,cgmul,amtmul,tipra,wilhlc,extnd(0:100)
dimension table(2,n),data(255)
do 200 j=1,n
num=j
if(j+1.ge.n) goto 2
if(table(1,j+1).le.table(1,j)) then
write(,) 'TAXSIM: in tablki',
& table(1,j),table(1,j+1),data(6)
endif
2 if(y.lt.table(1,j)) go to 210
200 continue
210 if(num.eq.1) then
tablk2 = table(2,num)
else if(num.lt.n) then
w = (y-table(1,num-1))/(table(1,num)-table(1,num-1))
if(table(2,num).gt.table(2,num-1)) then
tablk2 = wtable(2,num-1) + (1-w)table(2,num)
else
tablk2 = wtable(2,num) + (1-w)table(2,num-1)
endif
else if(num.eq.n) then
tablk2=table(2,num)
endif
if(extnd(88).gt.0.d0) tablk2 = table(2,max(1,num-1))
return
end
double precision function tablk3(table,n,y,data)
implicit double precision (A-H,O-Z)
common /psubr/ xndx,amtpi,almnpx,egtrra,almzbr,almst,enders,
&gjtrra,ratmul,cgmul,amtmul,tipra,wilhlc,extnd(0:100)
dimension table(2,n),data(255)
do 200 j=1,n
num=j
if(j+1.ge.n) goto 2
if(table(1,j+1).le.table(1,j)) then
write(,) 'TAXSIM: in tablk3',
& table(1,j),table(1,j+1),data(6)
endif
2 if(y.lt.table(1,j)) go to 210
200 continue
210 if(num.eq.1) then
tablk3 = table(2,num)
else if(num.lt.n) then
w = (y-table(1,num-1))/(table(1,num)-table(1,num-1))
if(table(2,num).gt.table(2,num-1)) then
tablk3 = wtable(2,num-1) + (1-w)table(2,num)
else
tablk3 = wtable(2,num) + (1-w)table(2,num-1)
endif
else if(num.eq.n) then
tablk3=table(2,num)
endif
if(extnd(88).gt.0.d0) tablk3 = table(2,max(1,num))
return
end
function lastk()
implicit double precision (A-H,O-Z)
lastk=13
return
end
double precision function sorm(mart,a,b)
implicit double precision (A-H,O-Z)
c this soubroutine determines married or single status
sorm=a
if(mart.eq.2.or.mart.eq.3.or.mart.eq.6)sORM=b
return
end
block data inpc87
implicit double precision (A-H,O-Z)
common/pce96/gnpd(1973:1999)
data gnpd
94.16d0,96.14d0,98.19d0,100.00d0,101.66d0,102.86d0,104.37d0/
end
c
double precision function keoles(data,comnew,lawyr)
implicit double precision (A-H,O-Z)
c adjusts keogh deductions to requested year levels
dimension data(255),comnew(255)
double precision keogh, kghmax,kghlim
kghmax = 7500.
if (lawyr.eq.1982.or.lawyr.eq.1983) kghmax = 15000.
if (lawyr.ge.1984) kghmax = 30000.
bus = data(17)+data(75)+data(79)-data(80)
retlim = max(0.0d0,.15*bus)
kghlim = min(retlim,kghmax)
keogh = min(data(28),kghlim)
keoles=max(0.0d0,comnew(14)-keogh)
return
end
c
double precision function irales(data,comnew,lawyr)
implicit double precision (A-H,O-Z)
c adjusts ira deductions tp requested year levels
dimension data(255),comnew(255)
double precision iramax, iralim, ira
integer sep
mst = int(data(2))
sep = 1
if(mst.eq.3.or.mst.eq.6) sep = 2
iramax = 3000.d0/sep
if (lawyr.ge.1981) iramax = 4000.d0/sep
if(mst.eq.1.or.mst.eq.4.or.mst.eq.7)iramax = iramax/2.
bus = data(17)+data(75)+data(79)-data(80)
busnet = max(0.0d0,bus-comnew(14))
iralim = min(data(11)+busnet,iramax)
ira = min(data(29),iralim)
irales=max(0.0d0,comnew(12)-ira)
return
end
c
double precision function divexc(data,comnew,law)
implicit double precision (A-H,O-Z)
c computes the amount of the federal div (int) excl
dimension data(255), comnew(255)
divexc=0.
diff=0.
if(law.ne.1981) diff= data(12) - comnew(4)
if(law.eq.1981) diff= data(12) + data(14) - comnew(4)
c3 format(' error in divexc, year:',i5,'divs:',f8.0,'int:',f8.0,
c + 'divs net of exc (from fed prg):',f8.0)
divexc=diff
return
end
c
double precision function disab(data,comnew,law)
implicit double precision (A-H,O-Z)
c computes amount of federal disability exclusion
dimension data(255),comnew(255)
disab=0.
if(law.ge.1981.and.law.le.1985) then
disab=data(25)
else
disab=max(0.0d0,data(25)-comnew(16))
endif
return
end
c
c
double precision function renter(data,comnew)
implicit double precision (A-H,O-Z)
c determines whether a return with no property tax is likely to
c pay rent
common/calc/hy,rent,agi,exemp,stded,xitded,taxinc,pcred,chcr,
& earncr,credit,rt,taxbc,rebate,energy,ctc,ylow,amt
dimension data(255), comnew(255)
renter=0.
c agi=max(0.0d0,comnew(2))
y=data(11)+data(23)
y=y+comnew(84)
if(data(51).lt.1.and.data(160).gt.0.) renter=1.
return
end
subroutine altax(data,comnew,statax,law)
parameter(last=2022,las=1)
implicit double precision (a-h,o-z)
integer sep,m2i(7)
dimension tab(2,4),tab82(2,3),xmp(2007:2022,2)
dimension std77(1977:2006,2),std07(2007:2022,4,3)
dimension data(255),comnew(255)
common/calc/hy,rent,agi,exemp,stded,xitded,taxinc,pcred,chcr,
&earncr,credit,rt,taxbc,rebate,energy,ctc,ylow,amt
common /psubr/ xndx,amtpi,almnpx,egtrra,almzbr,almst,enders,
&gjtrra,ratmul,cgmul,amtmul,tipra,wilhlc,extnd(0:100)
data tab /1000.0d0,1.5d0,3000.d0,3.d0,5000.d0,4.5d0,
& 1.e20,5.d0/
data tab82/500.0d0, 2.0d0, 3000.0d0, 4.0d0, 1.e20, 5.0d0/
data std77/5.1d0,25.2d0,51000.d0,252000./
data m2i/1,2,2,3,1,2,3/
c (single,joint,hoh)(po start,po end,maxstd,minstd)
data std07/
s 1220500.d0,323500.d0,las26000.d0,
b 1230000.d0,333000.d0,las35500.d0,
e 15 2500.d0,1 3000.d0,
n 15 2000.d0,1 2500.d0,
x 1220500.d0,323500.d0,las26000.d0,
2 1230000.d0,333000.d0,las35500.d0,
3 15 7500.d0,1 8500.d0,
4 15 4001.d0,1 5000.d0,
h 1220500.d0,423500.d0,
2 1230000.d0,433000.d0,
3 15 4700.d0,1 5200.d0,
4 15 2000.d0,1 2500.d0/
data xmp/1520000.d0,150000.d0,1550000.d0,1100000.d0/
rt=0.
mst = int(data(2))
sep = 1
if(mst.eq.3.or.mst.eq.6) sep = 2
c AGI
c no dividend exclusion
c Unemployment income is exempt from state taxes
c state tax refund is not taxable
agi=comnew(2)+divexc(data,comnew,law)-comnew(78)-data(22)
c setax for 2011-2
if(law.eq.2011.or.law.eq.2012) then
if(comnew(175).le.14204.) then
agi = agi + .5751(comnew(175)+data(44))
else
agi = agi + .5(comnew(175)+data(44)) + 1067
endif
else
agi = agi + .5*(comnew(175)+data(44))
endif
c The Capital Gains are treated similar to Federal Taxes,
c except that all gains are taxable and all losses are deductible in the year in
if(comnew(6).lt.0) agi = agi + comnew(5) - comnew(6)
if(law.le.1981) then
alimon=data(23)+data(62)
agi=agi-alimon
agi=agi+comnew(12)+comnew(14)
endif
if(law.ge.1982.and.law.le.1986) agi=agi+comnew(32)
c All social security income is exempt from state taxes
if(law.ge.1984)agi=agi-comnew(79)
if(law.ge.1987) agi=agi-data(26)
c Standard Deduction if(law.le.2006) then stded = twn(std77(law,1)agi,0.d0,data(7)std77(law,2)) else i=m2i(int(data(2))) j=int(data(7)+sep-1.d0) if(data(2).eq.4.d0.or.data(2).eq.7) i=3 por = ( std07(law,3,i)-std07(law,4,i))/ & (std07(law,2,i)-std07(law,1,i)) por=max(0.d0,por) excess=max(0.d0,agi-std07(law,1,j)/sep) stded = std07(law,3,i)/sep-excesspor stded = twn(stded,std07(law,4,i)/sep,std07(law,3,i)/sep) if(data(2).eq.4) then stded=1.72stded/2.d0 endif
c XITDED
ag=max(0.0d0,agi)
if(law.le.1982) then
xitded = data(56)+data(57)+comnew(23)+data(61)
& +max(0.0d0,data(63)-.02ag)+data(66)
else
xitded = data(56)+data(57)+comnew(23)+max(0.0d0,data(61)-.1ag)
& +max(0.0d0,data(63)-.02ag)+data(66)
endif
if(law.le.1991) then
xitded=xitded+max(0.0d0,max(0.0d0,data(48)-.01ag)+
& data(49)+min(150.0d0,data(47))-.03ag)
else if(law.ge.1992) then
xitded=xitded+max(0.0d0,data(49)-.04ag)
endif
if(law.ge.1982) xitded=xitded+data(51)+data(54)
if(law.ge.1982) then
fica = comnew(190)
else
fica=0.
endif
if(law.le.1981)xitded=xitded-max(0.0d0,comnew(23)-ag*.15)
c accounts for deduction of fed inc tax
c tax based on withholding; don't count for credits
if(law.le.1999)fedtax=max(comnew(1),0.0d0)
if(law.ge.2000.and.law.le.2008)fedtax =
& max(comnew(52)+comnew(70)-comnew(58),0.0d0)
c 2009+ Federal Income Tax deduction worksheet
if(law.ge.2009) fedtax = max(0.0d0,
& comnew(154)+comnew(173)-comnew(59)-comnew(93))
c Child Tax credit, child care credit, eic recomputed for 2020
if(law.eq.2021) then
d101 = law
d103 = law
data(101) = 2020
data(103) = 2020
call nlaw(data,2020)
chcare = comnew(53)
chcred = comnew(81)
eitc = comnew(59)
data(101) = d101
data(103) = d103
call nlaw(data,2021)
fedtax = max(0.0d0,
& comnew(52)+comnew(173)-eitc-chcred-chcare)
endif
deduc=max(stded,xitded)+fedtax
c EXEMPTIONS
if(int(data(2)).eq.2.or.data(2).eq.4) then
exemp=3000.
else
exemp=1500.
endif
c Dependent Exemptions
if(law.le.2005) then
exemp=exemp+300data(8)
else if(law.eq.2006) then
exemp=exemp+500data(8)
else
e88 = 1.d0 - extnd(88)
if(agi.lt.xmp(law,1)) then
xmpdep = 1000.d0 - e88agi/xmp(law,1)500.d0
elseif(agi.lt.xmp(law,2)) then
po = e88(agi-xmp(law,1))/(xmp(law,2)-xmp(law,1))
xmpdep = 500.d0(1.d0-po)
else
xmpdep = 300.d0
endif
xmpdep = max(xmpdep,0.d0)
exemp=exemp + xmpdep*data(8)
endif
taxinc = max(0.0d0,agi-deduc-exemp-fica)
if(law.le.1981) then
call look(tab, taxinc,4,n,statax,1.0d00,0.0d0,rt,data)
else if(law.ge.1982) then
taxy = taxinc
if(mst.eq.2) taxy = taxinc/2
call look(tab82,taxy,3,n,stat,1.0d00, 0.0d0,rt,data)
statax = stat
if(mst.eq.2) statax =stat*2
endif
c deduction for solar energy credit; non-refundable
solcrd=0.
if(law.ge.1981.and.law.le.1986)solcrd=data(38)
taxbc=statax
statax=max(0.0d0,statax-solcrd)
credit = solcrd
return
end
subroutine aktax(data,comnew,statax,law)
c Personal income tax repealed in 1980 after the oil boom.
implicit double precision (A-H,O-Z)
common/calc/hy,rent,agi,exemp,stded,xitded,taxinc,pcred,chcr,
&earncr,credit,rt,taxbc,rebate,energy,ctc,ylow,amt
dimension data(255),comnew(255)
dimension aktab1(2,25),aktab2(2,25),aktab3(2,25),cred(1977:1988)
data aktab1 / 2000.0d0, 3.0d0, 4000.0d0, 3.5d0,
& 6000.0d0, 4.0d0, 8000.0d0, 5.0d0, 10000.0d0, 2.5d0,
& 12000.0d0, 6.0d0, 14000.0d0, 7.0d0, 16000.0d0, 7.5d0,
& 18000.0d0, 8.0d0, 20000.0d0, 8.5d0, 22000.0d0, 9.0d0,
& 26000.0d0, 9.5d0, 32000.0d0,10.0d0, 38000.0d0,10.5d0,
& 44000.0d0,11.0d0, 50000.0d0,11.5d0, 60000.0d0,12.0d0,
& 70000.0d0,12.5d0, 80000.0d0,13.0d0, 90000.0d0,13.5d0,
&100000.0d0,14.0d0,150000.0d0,14.0d0, 1.e20, 14.5d0,
& 0.0d0, 0.0d0, 0.0d0, 0.0d0 /
data aktab2/
@bodiyang Can you look at the Differences_Explained.md
file and let me know if I've gotten the description of the differences in the "b" set correct? Thanks!
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 98.54%. Comparing base (
e2f14f3
) to head (7c9e432
).
@bodiyang Can you look at the
Differences_Explained.md
file and let me know if I've gotten the description of the differences in the "b" set correct? Thanks!
The description looks good to me. Just on point, it's better to clarify TAXMSIM
as TAXSIM-35
in the 'b' file section (because the updated testing version of TAXSIM have some calculation differences from TAXSIM-35).
I am completely baffled by what is going on. Can you just give me a call?
Daniel Feenberg 617-682-6204
On Wed, 17 Jan 2024, Bodi Yang wrote:
@bodiyang Can you look at the
Differences_Explained.md
file and let me know if I've gotten the description of the differences in the "b" set correct? Thanks!The description looks good to me. Just on point, it's better to clarify
TAXMSIM
asTAXSIM-35
in the 'b' file section (because the updated testing version of TAXSIM have some calculation differences from TAXSIM-35).-- Reply to this email directly or view it on GitHub: https://github.com/PSLmodels/Tax-Calculator/pull/2705#issuecomment-1895932573 You are receiving this because you commented.
Message ID: @.***>
This PR works through the validation of the "b" files in the TAXSIM-35 validation suite.
To validate: