kumi 0.0.25 → 0.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/README.md +70 -71
  4. data/data/functions/agg/boolean.yaml +6 -2
  5. data/data/functions/agg/numeric.yaml +32 -16
  6. data/data/functions/agg/string.yaml +4 -3
  7. data/data/functions/core/arithmetic.yaml +62 -14
  8. data/data/functions/core/boolean.yaml +12 -6
  9. data/data/functions/core/comparison.yaml +25 -13
  10. data/data/functions/core/constructor.yaml +16 -8
  11. data/data/functions/core/select.yaml +3 -1
  12. data/data/functions/core/stencil.yaml +14 -5
  13. data/data/functions/core/string.yaml +9 -4
  14. data/data/kernels/ruby/agg/numeric.yaml +1 -1
  15. data/docs/UNSAT_DETECTION.md +83 -0
  16. data/golden/array_element/expected/nast.txt +1 -1
  17. data/golden/array_element/expected/schema_ruby.rb +1 -1
  18. data/golden/array_index/expected/nast.txt +7 -7
  19. data/golden/array_index/expected/schema_ruby.rb +1 -1
  20. data/golden/array_operations/expected/nast.txt +2 -2
  21. data/golden/array_operations/expected/schema_ruby.rb +1 -1
  22. data/golden/array_operations/expected/snast.txt +3 -3
  23. data/golden/cascade_logic/expected/schema_ruby.rb +1 -1
  24. data/golden/cascade_logic/expected/snast.txt +2 -2
  25. data/golden/chained_fusion/expected/nast.txt +2 -2
  26. data/golden/chained_fusion/expected/schema_ruby.rb +1 -1
  27. data/golden/element_arrays/expected/nast.txt +2 -2
  28. data/golden/element_arrays/expected/schema_ruby.rb +1 -1
  29. data/golden/element_arrays/expected/snast.txt +1 -1
  30. data/golden/empty_and_null_inputs/expected/nast.txt +3 -3
  31. data/golden/empty_and_null_inputs/expected/schema_ruby.rb +1 -1
  32. data/golden/function_overload/expected/ast.txt +29 -0
  33. data/golden/function_overload/expected/input_plan.txt +4 -0
  34. data/golden/function_overload/expected/lir_00_unoptimized.txt +18 -0
  35. data/golden/function_overload/expected/lir_01_hoist_scalar_references.txt +18 -0
  36. data/golden/function_overload/expected/lir_02_inlined.txt +20 -0
  37. data/golden/function_overload/expected/lir_03_cse.txt +20 -0
  38. data/golden/function_overload/expected/lir_04_1_loop_fusion.txt +20 -0
  39. data/golden/function_overload/expected/lir_04_loop_invcm.txt +20 -0
  40. data/golden/function_overload/expected/lir_06_const_prop.txt +20 -0
  41. data/golden/function_overload/expected/nast.txt +22 -0
  42. data/golden/function_overload/expected/schema_javascript.mjs +12 -0
  43. data/golden/function_overload/expected/schema_ruby.rb +39 -0
  44. data/golden/function_overload/expected/snast.txt +22 -0
  45. data/golden/function_overload/input.json +8 -0
  46. data/golden/function_overload/schema.kumi +19 -0
  47. data/golden/game_of_life/expected/lir_00_unoptimized.txt +4 -4
  48. data/golden/game_of_life/expected/lir_01_hoist_scalar_references.txt +4 -4
  49. data/golden/game_of_life/expected/lir_02_inlined.txt +16 -16
  50. data/golden/game_of_life/expected/lir_03_cse.txt +20 -16
  51. data/golden/game_of_life/expected/lir_04_1_loop_fusion.txt +20 -16
  52. data/golden/game_of_life/expected/lir_04_loop_invcm.txt +20 -16
  53. data/golden/game_of_life/expected/lir_06_const_prop.txt +20 -16
  54. data/golden/game_of_life/expected/nast.txt +4 -4
  55. data/golden/game_of_life/expected/schema_javascript.mjs +4 -2
  56. data/golden/game_of_life/expected/schema_ruby.rb +5 -3
  57. data/golden/game_of_life/expected/snast.txt +10 -10
  58. data/golden/hash_keys/expected/schema_ruby.rb +1 -1
  59. data/golden/hash_value/expected/nast.txt +1 -1
  60. data/golden/hash_value/expected/schema_ruby.rb +1 -1
  61. data/golden/hash_value/expected/snast.txt +1 -1
  62. data/golden/hierarchical_complex/expected/nast.txt +3 -3
  63. data/golden/hierarchical_complex/expected/schema_ruby.rb +1 -1
  64. data/golden/hierarchical_complex/expected/snast.txt +3 -3
  65. data/golden/inline_rename_scope_leak/expected/nast.txt +3 -3
  66. data/golden/inline_rename_scope_leak/expected/schema_ruby.rb +1 -1
  67. data/golden/input_reference/expected/nast.txt +2 -2
  68. data/golden/input_reference/expected/schema_ruby.rb +1 -1
  69. data/golden/interleaved_fusion/expected/nast.txt +2 -2
  70. data/golden/interleaved_fusion/expected/schema_ruby.rb +1 -1
  71. data/golden/let_inline/expected/nast.txt +4 -4
  72. data/golden/let_inline/expected/schema_ruby.rb +1 -1
  73. data/golden/loop_fusion/expected/nast.txt +1 -1
  74. data/golden/loop_fusion/expected/schema_ruby.rb +1 -1
  75. data/golden/min_reduce_scope/expected/nast.txt +3 -3
  76. data/golden/min_reduce_scope/expected/schema_ruby.rb +1 -1
  77. data/golden/min_reduce_scope/expected/snast.txt +1 -1
  78. data/golden/mixed_dimensions/expected/nast.txt +2 -2
  79. data/golden/mixed_dimensions/expected/schema_ruby.rb +1 -1
  80. data/golden/multirank_hoisting/expected/nast.txt +7 -7
  81. data/golden/multirank_hoisting/expected/schema_ruby.rb +1 -1
  82. data/golden/nested_hash/expected/nast.txt +1 -1
  83. data/golden/nested_hash/expected/schema_ruby.rb +1 -1
  84. data/golden/reduction_broadcast/expected/nast.txt +3 -3
  85. data/golden/reduction_broadcast/expected/schema_ruby.rb +1 -1
  86. data/golden/reduction_broadcast/expected/snast.txt +1 -1
  87. data/golden/roll/expected/schema_ruby.rb +1 -1
  88. data/golden/shift/expected/schema_ruby.rb +1 -1
  89. data/golden/shift_2d/expected/schema_ruby.rb +1 -1
  90. data/golden/simple_math/expected/lir_00_unoptimized.txt +1 -1
  91. data/golden/simple_math/expected/lir_01_hoist_scalar_references.txt +1 -1
  92. data/golden/simple_math/expected/lir_02_inlined.txt +1 -1
  93. data/golden/simple_math/expected/lir_03_cse.txt +1 -1
  94. data/golden/simple_math/expected/lir_04_1_loop_fusion.txt +1 -1
  95. data/golden/simple_math/expected/lir_04_loop_invcm.txt +1 -1
  96. data/golden/simple_math/expected/lir_06_const_prop.txt +1 -1
  97. data/golden/simple_math/expected/nast.txt +5 -5
  98. data/golden/simple_math/expected/schema_ruby.rb +1 -1
  99. data/golden/simple_math/expected/snast.txt +2 -2
  100. data/golden/streaming_basics/expected/nast.txt +8 -8
  101. data/golden/streaming_basics/expected/schema_ruby.rb +1 -1
  102. data/golden/streaming_basics/expected/snast.txt +1 -1
  103. data/golden/tuples/expected/lir_00_unoptimized.txt +5 -5
  104. data/golden/tuples/expected/lir_01_hoist_scalar_references.txt +5 -5
  105. data/golden/tuples/expected/lir_02_inlined.txt +5 -5
  106. data/golden/tuples/expected/lir_03_cse.txt +5 -5
  107. data/golden/tuples/expected/lir_04_1_loop_fusion.txt +5 -5
  108. data/golden/tuples/expected/lir_04_loop_invcm.txt +5 -5
  109. data/golden/tuples/expected/lir_06_const_prop.txt +5 -5
  110. data/golden/tuples/expected/nast.txt +4 -4
  111. data/golden/tuples/expected/schema_ruby.rb +1 -1
  112. data/golden/tuples/expected/snast.txt +6 -6
  113. data/golden/tuples_and_arrays/expected/lir_00_unoptimized.txt +1 -1
  114. data/golden/tuples_and_arrays/expected/lir_01_hoist_scalar_references.txt +1 -1
  115. data/golden/tuples_and_arrays/expected/lir_02_inlined.txt +2 -2
  116. data/golden/tuples_and_arrays/expected/lir_03_cse.txt +2 -2
  117. data/golden/tuples_and_arrays/expected/lir_04_1_loop_fusion.txt +2 -2
  118. data/golden/tuples_and_arrays/expected/lir_04_loop_invcm.txt +2 -2
  119. data/golden/tuples_and_arrays/expected/lir_06_const_prop.txt +2 -2
  120. data/golden/tuples_and_arrays/expected/nast.txt +3 -3
  121. data/golden/tuples_and_arrays/expected/schema_ruby.rb +1 -1
  122. data/golden/tuples_and_arrays/expected/snast.txt +2 -2
  123. data/golden/us_tax_2024/expected/ast.txt +63 -670
  124. data/golden/us_tax_2024/expected/input_plan.txt +8 -45
  125. data/golden/us_tax_2024/expected/lir_00_unoptimized.txt +253 -863
  126. data/golden/us_tax_2024/expected/lir_01_hoist_scalar_references.txt +253 -863
  127. data/golden/us_tax_2024/expected/lir_02_inlined.txt +1215 -5139
  128. data/golden/us_tax_2024/expected/lir_03_cse.txt +587 -2460
  129. data/golden/us_tax_2024/expected/lir_04_1_loop_fusion.txt +632 -2480
  130. data/golden/us_tax_2024/expected/lir_04_loop_invcm.txt +587 -2460
  131. data/golden/us_tax_2024/expected/lir_06_const_prop.txt +587 -2460
  132. data/golden/us_tax_2024/expected/nast.txt +123 -826
  133. data/golden/us_tax_2024/expected/schema_javascript.mjs +127 -581
  134. data/golden/us_tax_2024/expected/schema_ruby.rb +135 -610
  135. data/golden/us_tax_2024/expected/snast.txt +155 -858
  136. data/golden/us_tax_2024/expected.json +120 -1
  137. data/golden/us_tax_2024/input.json +18 -9
  138. data/golden/us_tax_2024/schema.kumi +48 -178
  139. data/golden/with_constants/expected/lir_00_unoptimized.txt +1 -1
  140. data/golden/with_constants/expected/lir_01_hoist_scalar_references.txt +1 -1
  141. data/golden/with_constants/expected/lir_02_inlined.txt +1 -1
  142. data/golden/with_constants/expected/lir_03_cse.txt +1 -1
  143. data/golden/with_constants/expected/lir_04_1_loop_fusion.txt +1 -1
  144. data/golden/with_constants/expected/lir_04_loop_invcm.txt +1 -1
  145. data/golden/with_constants/expected/lir_06_const_prop.txt +1 -1
  146. data/golden/with_constants/expected/nast.txt +2 -2
  147. data/golden/with_constants/expected/schema_ruby.rb +1 -1
  148. data/golden/with_constants/expected/snast.txt +2 -2
  149. data/lib/kumi/analyzer.rb +12 -12
  150. data/lib/kumi/core/analyzer/passes/formal_constraint_propagator.rb +236 -0
  151. data/lib/kumi/core/analyzer/passes/input_collector.rb +22 -4
  152. data/lib/kumi/core/analyzer/passes/nast_dimensional_analyzer_pass.rb +64 -18
  153. data/lib/kumi/core/analyzer/passes/normalize_to_nast_pass.rb +9 -4
  154. data/lib/kumi/core/analyzer/passes/snast_pass.rb +3 -1
  155. data/lib/kumi/core/analyzer/passes/unsat_detector.rb +172 -198
  156. data/lib/kumi/core/error_reporter.rb +36 -1
  157. data/lib/kumi/core/errors.rb +33 -1
  158. data/lib/kumi/core/functions/function_spec.rb +5 -4
  159. data/lib/kumi/core/functions/loader.rb +17 -1
  160. data/lib/kumi/core/functions/overload_resolver.rb +164 -0
  161. data/lib/kumi/core/functions/type_error_reporter.rb +118 -0
  162. data/lib/kumi/core/functions/type_rules.rb +155 -35
  163. data/lib/kumi/core/types/inference.rb +29 -22
  164. data/lib/kumi/core/types/normalizer.rb +29 -45
  165. data/lib/kumi/core/types/validator.rb +16 -27
  166. data/lib/kumi/core/types/value_objects.rb +116 -0
  167. data/lib/kumi/core/types.rb +45 -37
  168. data/lib/kumi/registry_v2/loader.rb +90 -0
  169. data/lib/kumi/registry_v2.rb +18 -1
  170. data/lib/kumi/version.rb +1 -1
  171. metadata +21 -7
  172. data/lib/kumi/core/analyzer/unsat_constant_evaluator.rb +0 -59
  173. data/lib/kumi/core/atom_unsat_solver.rb +0 -396
  174. data/lib/kumi/core/constraint_relationship_solver.rb +0 -641
  175. data/lib/kumi/core/types/builder.rb +0 -23
  176. data/lib/kumi/core/types/compatibility.rb +0 -96
  177. data/lib/kumi/core/types/formatter.rb +0 -26
@@ -11,891 +11,281 @@
11
11
  %t6 = call core.mul(%t4, %t5) :: float
12
12
  yield %t6
13
13
  )
14
- (Declaration taxable_single
15
- %t7 = load_input "income" :: float
16
- %t8 = load_input "fed" :: any
17
- %t9 = load_field t8["single"] :: any
18
- %t10 = load_field t9["std"] :: float
19
- %t11 = call core.sub(%t7, %t10) :: float
20
- %t12 = const 0 :: integer
21
- %t13 = make_tuple(%t11, %t12) :: tuple<float, integer>
22
- %t14 = fold %t13 fn="agg.max" :: float
23
- yield %t14
24
- )
25
- (Declaration lo_s
26
- %t15 = load_input "fed" :: array
27
- %t16 = load_field t15["single"] :: any
28
- %t17 = load_field t16["rates"] :: any
29
- loop rates id=L1 in %t17 as el=%rates_el_18, idx=%rates_i_19
30
- %t20 = load_field rates_el_18["lo"] :: float
31
- yield %t20
32
- end_loop
33
- )
34
- (Declaration hi_s
35
- %t21 = load_input "fed" :: array
36
- %t22 = load_field t21["single"] :: any
37
- %t23 = load_field t22["rates"] :: any
38
- loop rates id=L2 in %t23 as el=%rates_el_24, idx=%rates_i_25
39
- %t26 = load_field rates_el_24["hi"] :: float
40
- yield %t26
41
- end_loop
42
- )
43
- (Declaration rate_s
44
- %t27 = load_input "fed" :: array
45
- %t28 = load_field t27["single"] :: any
46
- %t29 = load_field t28["rates"] :: any
47
- loop rates id=L3 in %t29 as el=%rates_el_30, idx=%rates_i_31
48
- %t32 = load_field rates_el_30["rate"] :: float
49
- yield %t32
14
+ (Declaration taxable
15
+ %t7 = load_input "statuses" :: array
16
+ loop statuses id=L1 in %t7 as el=%statuses_el_8, idx=%statuses_i_9
17
+ %t10 = load_input "income" :: float
18
+ %t11 = load_field statuses_el_8["std"] :: float
19
+ %t12 = call core.sub(%t10, %t11) :: float
20
+ %t13 = const 0 :: integer
21
+ %t14 = make_tuple(%t12, %t13) :: tuple<float, integer>
22
+ %t15 = fold %t14 fn="agg.max" :: float
23
+ yield %t15
24
+ end_loop
25
+ )
26
+ (Declaration lo
27
+ %t16 = load_input "statuses" :: array
28
+ loop statuses id=L2 in %t16 as el=%statuses_el_17, idx=%statuses_i_18
29
+ %t19 = load_field statuses_el_17["rates"] :: any
30
+ loop rates id=L3 in %t19 as el=%rates_el_20, idx=%rates_i_21
31
+ %t22 = load_field rates_el_20["lo"] :: float
32
+ yield %t22
33
+ end_loop
34
+ end_loop
35
+ )
36
+ (Declaration hi
37
+ %t23 = load_input "statuses" :: array
38
+ loop statuses id=L4 in %t23 as el=%statuses_el_24, idx=%statuses_i_25
39
+ %t26 = load_field statuses_el_24["rates"] :: any
40
+ loop rates id=L5 in %t26 as el=%rates_el_27, idx=%rates_i_28
41
+ %t29 = load_field rates_el_27["hi"] :: float
42
+ yield %t29
43
+ end_loop
44
+ end_loop
45
+ )
46
+ (Declaration rate
47
+ %t30 = load_input "statuses" :: array
48
+ loop statuses id=L6 in %t30 as el=%statuses_el_31, idx=%statuses_i_32
49
+ %t33 = load_field statuses_el_31["rates"] :: any
50
+ loop rates id=L7 in %t33 as el=%rates_el_34, idx=%rates_i_35
51
+ %t36 = load_field rates_el_34["rate"] :: float
52
+ yield %t36
53
+ end_loop
50
54
  end_loop
51
55
  )
52
56
  (Declaration big_hi
53
- %t33 = const 100000000000.0 :: float
54
- yield %t33
55
- )
56
- (Declaration hi_s_eff
57
- %t34 = load_input "fed" :: array
58
- %t35 = load_field t34["single"] :: any
59
- %t36 = load_field t35["rates"] :: any
60
- loop rates id=L4 in %t36 as el=%rates_el_37, idx=%rates_i_38
61
- %t39 = load_decl hi_s axes=[rates] :: float
62
- %t40 = const -1 :: integer
63
- %t41 = call core.eq(%t39, %t40) :: boolean
64
- %t42 = const 100000000000.0 :: float
65
- %t43 = load_decl hi_s axes=[rates] :: float
66
- %t44 = select %t41, %t42, %t43 :: float
67
- yield %t44
68
- end_loop
69
- )
70
- (Declaration amt_s
71
- %t45 = load_input "fed" :: array
72
- %t46 = load_field t45["single"] :: any
73
- %t47 = load_field t46["rates"] :: any
74
- %t50 = load_decl taxable_single :: float
75
- loop rates id=L5 in %t47 as el=%rates_el_48, idx=%rates_i_49
76
- %t51 = load_decl lo_s axes=[rates] :: float
77
- %t52 = call core.sub(%t50, %t51) :: float
78
- %t53 = const 0 :: integer
79
- %t54 = load_decl hi_s_eff axes=[rates] :: float
80
- %t55 = load_decl lo_s axes=[rates] :: float
81
- %t56 = call core.sub(%t54, %t55) :: float
82
- %t57 = call core.clamp(%t52, %t53, %t56) :: float
83
- yield %t57
84
- end_loop
85
- )
86
- (Declaration fed_tax_single
87
- %acc_58 = decl_acc :: float
88
- %t59 = load_input "fed" :: array
89
- %t60 = load_field t59["single"] :: any
90
- %t61 = load_field t60["rates"] :: any
91
- loop rates id=L6 in %t61 as el=%rates_el_62, idx=%rates_i_63
92
- %t64 = load_decl amt_s axes=[rates] :: float
93
- %t65 = load_decl rate_s axes=[rates] :: float
94
- %t66 = call core.mul(%t64, %t65) :: float
95
- %acc_58 = acc_add agg.sum(%acc_58, %t66) :: float
96
- end_loop
97
- %t67 = acc_load %acc_58 :: float
98
- yield %t67
99
- )
100
- (Declaration in_br_s
101
- %t68 = load_input "fed" :: array
102
- %t69 = load_field t68["single"] :: any
103
- %t70 = load_field t69["rates"] :: any
104
- %t73 = load_decl taxable_single :: float
105
- %t76 = load_decl taxable_single :: float
106
- loop rates id=L7 in %t70 as el=%rates_el_71, idx=%rates_i_72
107
- %t74 = load_decl lo_s axes=[rates] :: float
108
- %t75 = call core.gte(%t73, %t74) :: boolean
109
- %t77 = load_decl hi_s_eff axes=[rates] :: float
110
- %t78 = call core.lt(%t76, %t77) :: boolean
111
- %t79 = call core.and(%t75, %t78) :: boolean
112
- yield %t79
113
- end_loop
114
- )
115
- (Declaration fed_marginal_single
116
- %acc_80 = decl_acc :: float
117
- %t81 = load_input "fed" :: array
118
- %t82 = load_field t81["single"] :: any
119
- %t83 = load_field t82["rates"] :: any
120
- loop rates id=L8 in %t83 as el=%rates_el_84, idx=%rates_i_85
121
- %t86 = load_decl in_br_s axes=[rates] :: boolean
122
- %t87 = load_decl rate_s axes=[rates] :: float
123
- %t88 = const 0 :: integer
124
- %t89 = select %t86, %t87, %t88 :: float
125
- %acc_80 = acc_add agg.sum(%acc_80, %t89) :: float
57
+ %t37 = const 100000000000.0 :: float
58
+ yield %t37
59
+ )
60
+ (Declaration hi_eff
61
+ %t38 = load_input "statuses" :: array
62
+ loop statuses id=L8 in %t38 as el=%statuses_el_39, idx=%statuses_i_40
63
+ %t41 = load_field statuses_el_39["rates"] :: any
64
+ loop rates id=L9 in %t41 as el=%rates_el_42, idx=%rates_i_43
65
+ %t44 = load_decl hi axes=[statuses, rates] :: float
66
+ %t45 = const -1 :: integer
67
+ %t46 = call core.eq(%t44, %t45) :: boolean
68
+ %t47 = const 100000000000.0 :: float
69
+ %t48 = load_decl hi axes=[statuses, rates] :: float
70
+ %t49 = select %t46, %t47, %t48 :: float
71
+ yield %t49
72
+ end_loop
73
+ end_loop
74
+ )
75
+ (Declaration amt
76
+ %t50 = load_input "statuses" :: array
77
+ loop statuses id=L10 in %t50 as el=%statuses_el_51, idx=%statuses_i_52
78
+ %t53 = load_field statuses_el_51["rates"] :: any
79
+ loop rates id=L11 in %t53 as el=%rates_el_54, idx=%rates_i_55
80
+ %t56 = load_decl taxable axes=[statuses] :: float
81
+ %t57 = load_decl lo axes=[statuses, rates] :: float
82
+ %t58 = call core.sub(%t56, %t57) :: float
83
+ %t59 = const 0 :: integer
84
+ %t60 = load_decl hi_eff axes=[statuses, rates] :: float
85
+ %t61 = load_decl lo axes=[statuses, rates] :: float
86
+ %t62 = call core.sub(%t60, %t61) :: float
87
+ %t63 = call core.clamp(%t58, %t59, %t62) :: float
88
+ yield %t63
89
+ end_loop
90
+ end_loop
91
+ )
92
+ (Declaration fed_tax
93
+ %t64 = load_input "statuses" :: array
94
+ loop statuses id=L12 in %t64 as el=%statuses_el_65, idx=%statuses_i_66
95
+ %acc_67 = decl_acc :: float
96
+ %t68 = load_field statuses_el_65["rates"] :: any
97
+ loop rates id=L13 in %t68 as el=%rates_el_69, idx=%rates_i_70
98
+ %t71 = load_decl amt axes=[statuses, rates] :: float
99
+ %t72 = load_decl rate axes=[statuses, rates] :: float
100
+ %t73 = call core.mul(%t71, %t72) :: float
101
+ %acc_67 = acc_add agg.sum(%acc_67, %t73) :: float
102
+ end_loop
103
+ %t74 = acc_load %acc_67 :: float
104
+ yield %t74
105
+ end_loop
106
+ )
107
+ (Declaration in_br
108
+ %t75 = load_input "statuses" :: array
109
+ loop statuses id=L14 in %t75 as el=%statuses_el_76, idx=%statuses_i_77
110
+ %t78 = load_field statuses_el_76["rates"] :: any
111
+ loop rates id=L15 in %t78 as el=%rates_el_79, idx=%rates_i_80
112
+ %t81 = load_decl taxable axes=[statuses] :: float
113
+ %t82 = load_decl lo axes=[statuses, rates] :: float
114
+ %t83 = call core.gte(%t81, %t82) :: boolean
115
+ %t84 = load_decl taxable axes=[statuses] :: float
116
+ %t85 = load_decl hi_eff axes=[statuses, rates] :: float
117
+ %t86 = call core.lt(%t84, %t85) :: boolean
118
+ %t87 = call core.and(%t83, %t86) :: boolean
119
+ yield %t87
120
+ end_loop
121
+ end_loop
122
+ )
123
+ (Declaration fed_marg
124
+ %t88 = load_input "statuses" :: array
125
+ loop statuses id=L16 in %t88 as el=%statuses_el_89, idx=%statuses_i_90
126
+ %acc_91 = decl_acc :: float
127
+ %t92 = load_field statuses_el_89["rates"] :: any
128
+ loop rates id=L17 in %t92 as el=%rates_el_93, idx=%rates_i_94
129
+ %t95 = load_decl in_br axes=[statuses, rates] :: boolean
130
+ %t96 = load_decl rate axes=[statuses, rates] :: float
131
+ %t97 = const 0 :: integer
132
+ %t98 = select %t95, %t96, %t97 :: float
133
+ %acc_91 = acc_add agg.sum(%acc_91, %t98) :: float
134
+ end_loop
135
+ %t99 = acc_load %acc_91 :: float
136
+ yield %t99
137
+ end_loop
138
+ )
139
+ (Declaration fed_eff
140
+ %t100 = load_input "statuses" :: array
141
+ loop statuses id=L18 in %t100 as el=%statuses_el_101, idx=%statuses_i_102
142
+ %t103 = load_decl fed_tax axes=[statuses] :: float
143
+ %t104 = load_input "income" :: float
144
+ %t105 = const 1.0 :: float
145
+ %t106 = make_tuple(%t104, %t105) :: tuple<float, float>
146
+ %t107 = fold %t106 fn="agg.max" :: float
147
+ %t108 = call core.div(%t103, %t107) :: float
148
+ yield %t108
126
149
  end_loop
127
- %t90 = acc_load %acc_80 :: float
128
- yield %t90
129
- )
130
- (Declaration fed_eff_single
131
- %t91 = load_decl fed_tax_single :: float
132
- %t92 = load_input "income" :: float
133
- %t93 = const 1.0 :: float
134
- %t94 = make_tuple(%t92, %t93) :: tuple<float>
135
- %t95 = fold %t94 fn="agg.max" :: float
136
- %t96 = call core.div(%t91, %t95) :: float
137
- yield %t96
138
150
  )
139
151
  (Declaration ss_wage_base
140
- %t97 = const 168600.0 :: float
141
- yield %t97
142
- )
143
- (Declaration ss_rate
144
- %t98 = const 0.062 :: float
145
- yield %t98
146
- )
147
- (Declaration ss_tax_s
148
- %t99 = load_input "income" :: float
149
- %t100 = const 168600.0 :: float
150
- %t101 = make_tuple(%t99, %t100) :: tuple<float>
151
- %t102 = fold %t101 fn="agg.min" :: float
152
- %t103 = const 0.062 :: float
153
- %t104 = call core.mul(%t102, %t103) :: float
154
- yield %t104
155
- )
156
- (Declaration med_base_rate
157
- %t105 = const 0.0145 :: float
158
- yield %t105
159
- )
160
- (Declaration med_tax_s
161
- %t106 = load_input "income" :: float
162
- %t107 = const 0.0145 :: float
163
- %t108 = call core.mul(%t106, %t107) :: float
164
- yield %t108
165
- )
166
- (Declaration addl_threshold_single
167
- %t109 = const 200000.0 :: float
152
+ %t109 = const 168600.0 :: float
168
153
  yield %t109
169
154
  )
170
- (Declaration addl_med_rate
171
- %t110 = const 0.009 :: float
155
+ (Declaration ss_rate
156
+ %t110 = const 0.062 :: float
172
157
  yield %t110
173
158
  )
174
- (Declaration addl_med_tax_s
159
+ (Declaration ss_tax
175
160
  %t111 = load_input "income" :: float
176
- %t112 = const 200000.0 :: float
177
- %t113 = call core.sub(%t111, %t112) :: float
178
- %t114 = const 0 :: integer
179
- %t115 = make_tuple(%t113, %t114) :: tuple<float, integer>
180
- %t116 = fold %t115 fn="agg.max" :: float
181
- %t117 = const 0.009 :: float
182
- %t118 = call core.mul(%t116, %t117) :: float
183
- yield %t118
184
- )
185
- (Declaration fica_tax_single
186
- %t119 = load_decl ss_tax_s :: float
187
- %t120 = load_decl med_tax_s :: float
188
- %t121 = call core.add(%t119, %t120) :: float
189
- %t122 = load_decl addl_med_tax_s :: float
190
- %t123 = call core.add(%t121, %t122) :: float
191
- yield %t123
192
- )
193
- (Declaration fica_eff_single
194
- %t124 = load_decl fica_tax_single :: float
195
- %t125 = load_input "income" :: float
196
- %t126 = const 1.0 :: float
197
- %t127 = make_tuple(%t125, %t126) :: tuple<float>
198
- %t128 = fold %t127 fn="agg.max" :: float
199
- %t129 = call core.div(%t124, %t128) :: float
200
- yield %t129
201
- )
202
- (Declaration total_tax_single
203
- %t130 = load_decl fed_tax_single :: float
204
- %t131 = load_decl fica_tax_single :: float
205
- %t132 = call core.add(%t130, %t131) :: float
206
- %t133 = load_decl state_tax :: float
207
- %t134 = call core.add(%t132, %t133) :: float
208
- %t135 = load_decl local_tax :: float
209
- %t136 = call core.add(%t134, %t135) :: float
210
- yield %t136
211
- )
212
- (Declaration total_eff_single
213
- %t137 = load_decl total_tax_single :: float
214
- %t138 = load_input "income" :: float
215
- %t139 = const 1.0 :: float
216
- %t140 = make_tuple(%t138, %t139) :: tuple<float>
217
- %t141 = fold %t140 fn="agg.max" :: float
218
- %t142 = call core.div(%t137, %t141) :: float
219
- yield %t142
161
+ %t112 = const 168600.0 :: float
162
+ %t113 = make_tuple(%t111, %t112) :: tuple<float, float>
163
+ %t114 = fold %t113 fn="agg.min" :: float
164
+ %t115 = const 0.062 :: float
165
+ %t116 = call core.mul(%t114, %t115) :: float
166
+ yield %t116
220
167
  )
221
- (Declaration after_tax_single
222
- %t143 = load_input "income" :: float
223
- %t144 = load_decl total_tax_single :: float
224
- %t145 = call core.sub(%t143, %t144) :: float
225
- yield %t145
226
- )
227
- (Declaration take_home_single
228
- %t146 = load_decl after_tax_single :: float
229
- %t147 = load_input "retirement_contrib" :: float
230
- %t148 = call core.sub(%t146, %t147) :: float
231
- yield %t148
232
- )
233
- (Declaration taxable_mj
234
- %t149 = load_input "income" :: float
235
- %t150 = load_input "fed" :: any
236
- %t151 = load_field t150["married_joint"] :: any
237
- %t152 = load_field t151["std"] :: float
238
- %t153 = call core.sub(%t149, %t152) :: float
239
- %t154 = const 0 :: integer
240
- %t155 = make_tuple(%t153, %t154) :: tuple<float, integer>
241
- %t156 = fold %t155 fn="agg.max" :: float
242
- yield %t156
168
+ (Declaration med_base_rate
169
+ %t117 = const 0.0145 :: float
170
+ yield %t117
243
171
  )
244
- (Declaration lo_mj
245
- %t157 = load_input "fed" :: array
246
- %t158 = load_field t157["married_joint"] :: any
247
- %t159 = load_field t158["rates"] :: any
248
- loop rates id=L9 in %t159 as el=%rates_el_160, idx=%rates_i_161
249
- %t162 = load_field rates_el_160["lo"] :: float
250
- yield %t162
251
- end_loop
172
+ (Declaration med_tax
173
+ %t118 = load_input "income" :: float
174
+ %t119 = const 0.0145 :: float
175
+ %t120 = call core.mul(%t118, %t119) :: float
176
+ yield %t120
252
177
  )
253
- (Declaration hi_mj
254
- %t163 = load_input "fed" :: array
255
- %t164 = load_field t163["married_joint"] :: any
256
- %t165 = load_field t164["rates"] :: any
257
- loop rates id=L10 in %t165 as el=%rates_el_166, idx=%rates_i_167
258
- %t168 = load_field rates_el_166["hi"] :: float
178
+ (Declaration addl_med_rate
179
+ %t121 = const 0.009 :: float
180
+ yield %t121
181
+ )
182
+ (Declaration addl_med_tax
183
+ %t122 = load_input "statuses" :: array
184
+ loop statuses id=L19 in %t122 as el=%statuses_el_123, idx=%statuses_i_124
185
+ %t125 = load_input "income" :: float
186
+ %t126 = load_field statuses_el_123["addl_threshold"] :: float
187
+ %t127 = call core.sub(%t125, %t126) :: float
188
+ %t128 = const 0 :: integer
189
+ %t129 = make_tuple(%t127, %t128) :: tuple<float, integer>
190
+ %t130 = fold %t129 fn="agg.max" :: float
191
+ %t131 = const 0.009 :: float
192
+ %t132 = call core.mul(%t130, %t131) :: float
193
+ yield %t132
194
+ end_loop
195
+ )
196
+ (Declaration fica_tax
197
+ %t133 = load_input "statuses" :: array
198
+ %t136 = load_decl ss_tax :: float
199
+ %t137 = load_decl med_tax :: float
200
+ loop statuses id=L20 in %t133 as el=%statuses_el_134, idx=%statuses_i_135
201
+ %t138 = call core.add(%t136, %t137) :: float
202
+ %t139 = load_decl addl_med_tax axes=[statuses] :: float
203
+ %t140 = call core.add(%t138, %t139) :: float
204
+ yield %t140
205
+ end_loop
206
+ )
207
+ (Declaration fica_eff
208
+ %t141 = load_input "statuses" :: array
209
+ loop statuses id=L21 in %t141 as el=%statuses_el_142, idx=%statuses_i_143
210
+ %t144 = load_decl fica_tax axes=[statuses] :: float
211
+ %t145 = load_input "income" :: float
212
+ %t146 = const 1.0 :: float
213
+ %t147 = make_tuple(%t145, %t146) :: tuple<float, float>
214
+ %t148 = fold %t147 fn="agg.max" :: float
215
+ %t149 = call core.div(%t144, %t148) :: float
216
+ yield %t149
217
+ end_loop
218
+ )
219
+ (Declaration total_tax
220
+ %t150 = load_input "statuses" :: array
221
+ %t156 = load_decl state_tax :: float
222
+ %t158 = load_decl local_tax :: float
223
+ loop statuses id=L22 in %t150 as el=%statuses_el_151, idx=%statuses_i_152
224
+ %t153 = load_decl fed_tax axes=[statuses] :: float
225
+ %t154 = load_decl fica_tax axes=[statuses] :: float
226
+ %t155 = call core.add(%t153, %t154) :: float
227
+ %t157 = call core.add(%t155, %t156) :: float
228
+ %t159 = call core.add(%t157, %t158) :: float
229
+ yield %t159
230
+ end_loop
231
+ )
232
+ (Declaration total_eff
233
+ %t160 = load_input "statuses" :: array
234
+ loop statuses id=L23 in %t160 as el=%statuses_el_161, idx=%statuses_i_162
235
+ %t163 = load_decl total_tax axes=[statuses] :: float
236
+ %t164 = load_input "income" :: float
237
+ %t165 = const 1.0 :: float
238
+ %t166 = make_tuple(%t164, %t165) :: tuple<float, float>
239
+ %t167 = fold %t166 fn="agg.max" :: float
240
+ %t168 = call core.div(%t163, %t167) :: float
259
241
  yield %t168
260
242
  end_loop
261
243
  )
262
- (Declaration rate_mj
263
- %t169 = load_input "fed" :: array
264
- %t170 = load_field t169["married_joint"] :: any
265
- %t171 = load_field t170["rates"] :: any
266
- loop rates id=L11 in %t171 as el=%rates_el_172, idx=%rates_i_173
267
- %t174 = load_field rates_el_172["rate"] :: float
244
+ (Declaration after_tax
245
+ %t169 = load_input "statuses" :: array
246
+ loop statuses id=L24 in %t169 as el=%statuses_el_170, idx=%statuses_i_171
247
+ %t172 = load_input "income" :: float
248
+ %t173 = load_decl total_tax axes=[statuses] :: float
249
+ %t174 = call core.sub(%t172, %t173) :: float
268
250
  yield %t174
269
251
  end_loop
270
252
  )
271
- (Declaration hi_mj_eff
272
- %t175 = load_input "fed" :: array
273
- %t176 = load_field t175["married_joint"] :: any
274
- %t177 = load_field t176["rates"] :: any
275
- loop rates id=L12 in %t177 as el=%rates_el_178, idx=%rates_i_179
276
- %t180 = load_decl hi_mj axes=[rates] :: float
277
- %t181 = const -1 :: integer
278
- %t182 = call core.eq(%t180, %t181) :: boolean
279
- %t183 = const 100000000000.0 :: float
280
- %t184 = load_decl hi_mj axes=[rates] :: float
281
- %t185 = select %t182, %t183, %t184 :: float
282
- yield %t185
283
- end_loop
284
- )
285
- (Declaration amt_mj
286
- %t186 = load_input "fed" :: array
287
- %t187 = load_field t186["married_joint"] :: any
288
- %t188 = load_field t187["rates"] :: any
289
- %t191 = load_decl taxable_mj :: float
290
- loop rates id=L13 in %t188 as el=%rates_el_189, idx=%rates_i_190
291
- %t192 = load_decl lo_mj axes=[rates] :: float
292
- %t193 = call core.sub(%t191, %t192) :: float
293
- %t194 = const 0 :: integer
294
- %t195 = load_decl hi_mj_eff axes=[rates] :: float
295
- %t196 = load_decl lo_mj axes=[rates] :: float
296
- %t197 = call core.sub(%t195, %t196) :: float
297
- %t198 = call core.clamp(%t193, %t194, %t197) :: float
298
- yield %t198
299
- end_loop
300
- )
301
- (Declaration fed_tax_mj
302
- %acc_199 = decl_acc :: float
303
- %t200 = load_input "fed" :: array
304
- %t201 = load_field t200["married_joint"] :: any
305
- %t202 = load_field t201["rates"] :: any
306
- loop rates id=L14 in %t202 as el=%rates_el_203, idx=%rates_i_204
307
- %t205 = load_decl amt_mj axes=[rates] :: float
308
- %t206 = load_decl rate_mj axes=[rates] :: float
309
- %t207 = call core.mul(%t205, %t206) :: float
310
- %acc_199 = acc_add agg.sum(%acc_199, %t207) :: float
311
- end_loop
312
- %t208 = acc_load %acc_199 :: float
313
- yield %t208
314
- )
315
- (Declaration in_br_mj
316
- %t209 = load_input "fed" :: array
317
- %t210 = load_field t209["married_joint"] :: any
318
- %t211 = load_field t210["rates"] :: any
319
- %t214 = load_decl taxable_mj :: float
320
- %t217 = load_decl taxable_mj :: float
321
- loop rates id=L15 in %t211 as el=%rates_el_212, idx=%rates_i_213
322
- %t215 = load_decl lo_mj axes=[rates] :: float
323
- %t216 = call core.gte(%t214, %t215) :: boolean
324
- %t218 = load_decl hi_mj_eff axes=[rates] :: float
325
- %t219 = call core.lt(%t217, %t218) :: boolean
326
- %t220 = call core.and(%t216, %t219) :: boolean
327
- yield %t220
328
- end_loop
329
- )
330
- (Declaration fed_marginal_mj
331
- %acc_221 = decl_acc :: float
332
- %t222 = load_input "fed" :: array
333
- %t223 = load_field t222["married_joint"] :: any
334
- %t224 = load_field t223["rates"] :: any
335
- loop rates id=L16 in %t224 as el=%rates_el_225, idx=%rates_i_226
336
- %t227 = load_decl in_br_mj axes=[rates] :: boolean
337
- %t228 = load_decl rate_mj axes=[rates] :: float
338
- %t229 = const 0 :: integer
339
- %t230 = select %t227, %t228, %t229 :: float
340
- %acc_221 = acc_add agg.sum(%acc_221, %t230) :: float
341
- end_loop
342
- %t231 = acc_load %acc_221 :: float
343
- yield %t231
344
- )
345
- (Declaration fed_eff_mj
346
- %t232 = load_decl fed_tax_mj :: float
347
- %t233 = load_input "income" :: float
348
- %t234 = const 1.0 :: float
349
- %t235 = make_tuple(%t233, %t234) :: tuple<float>
350
- %t236 = fold %t235 fn="agg.max" :: float
351
- %t237 = call core.div(%t232, %t236) :: float
352
- yield %t237
353
- )
354
- (Declaration ss_tax_mj
355
- %t238 = load_decl ss_tax_s :: float
356
- yield %t238
357
- )
358
- (Declaration med_tax_mj
359
- %t239 = load_decl med_tax_s :: float
360
- yield %t239
361
- )
362
- (Declaration addl_threshold_mj
363
- %t240 = const 250000.0 :: float
364
- yield %t240
365
- )
366
- (Declaration addl_med_tax_mj
367
- %t241 = load_input "income" :: float
368
- %t242 = const 250000.0 :: float
369
- %t243 = call core.sub(%t241, %t242) :: float
370
- %t244 = const 0 :: integer
371
- %t245 = make_tuple(%t243, %t244) :: tuple<float, integer>
372
- %t246 = fold %t245 fn="agg.max" :: float
373
- %t247 = const 0.009 :: float
374
- %t248 = call core.mul(%t246, %t247) :: float
375
- yield %t248
376
- )
377
- (Declaration fica_tax_mj
378
- %t249 = load_decl ss_tax_mj :: float
379
- %t250 = load_decl med_tax_mj :: float
380
- %t251 = call core.add(%t249, %t250) :: float
381
- %t252 = load_decl addl_med_tax_mj :: float
382
- %t253 = call core.add(%t251, %t252) :: float
383
- yield %t253
384
- )
385
- (Declaration fica_eff_mj
386
- %t254 = load_decl fica_tax_mj :: float
387
- %t255 = load_input "income" :: float
388
- %t256 = const 1.0 :: float
389
- %t257 = make_tuple(%t255, %t256) :: tuple<float>
390
- %t258 = fold %t257 fn="agg.max" :: float
391
- %t259 = call core.div(%t254, %t258) :: float
392
- yield %t259
393
- )
394
- (Declaration total_tax_mj
395
- %t260 = load_decl fed_tax_mj :: float
396
- %t261 = load_decl fica_tax_mj :: float
397
- %t262 = call core.add(%t260, %t261) :: float
398
- %t263 = load_decl state_tax :: float
399
- %t264 = call core.add(%t262, %t263) :: float
400
- %t265 = load_decl local_tax :: float
401
- %t266 = call core.add(%t264, %t265) :: float
402
- yield %t266
403
- )
404
- (Declaration total_eff_mj
405
- %t267 = load_decl total_tax_mj :: float
406
- %t268 = load_input "income" :: float
407
- %t269 = const 1.0 :: float
408
- %t270 = make_tuple(%t268, %t269) :: tuple<float>
409
- %t271 = fold %t270 fn="agg.max" :: float
410
- %t272 = call core.div(%t267, %t271) :: float
411
- yield %t272
412
- )
413
- (Declaration after_tax_mj
414
- %t273 = load_input "income" :: float
415
- %t274 = load_decl total_tax_mj :: float
416
- %t275 = call core.sub(%t273, %t274) :: float
417
- yield %t275
418
- )
419
- (Declaration take_home_mj
420
- %t276 = load_decl after_tax_mj :: float
421
- %t277 = load_input "retirement_contrib" :: float
422
- %t278 = call core.sub(%t276, %t277) :: float
423
- yield %t278
424
- )
425
- (Declaration taxable_ms
426
- %t279 = load_input "income" :: float
427
- %t280 = load_input "fed" :: any
428
- %t281 = load_field t280["married_separate"] :: any
429
- %t282 = load_field t281["std"] :: float
430
- %t283 = call core.sub(%t279, %t282) :: float
431
- %t284 = const 0 :: integer
432
- %t285 = make_tuple(%t283, %t284) :: tuple<float, integer>
433
- %t286 = fold %t285 fn="agg.max" :: float
434
- yield %t286
435
- )
436
- (Declaration lo_ms
437
- %t287 = load_input "fed" :: array
438
- %t288 = load_field t287["married_separate"] :: any
439
- %t289 = load_field t288["rates"] :: any
440
- loop rates id=L17 in %t289 as el=%rates_el_290, idx=%rates_i_291
441
- %t292 = load_field rates_el_290["lo"] :: float
442
- yield %t292
253
+ (Declaration take_home
254
+ %t175 = load_input "statuses" :: array
255
+ loop statuses id=L25 in %t175 as el=%statuses_el_176, idx=%statuses_i_177
256
+ %t178 = load_decl after_tax axes=[statuses] :: float
257
+ %t179 = load_input "retirement_contrib" :: float
258
+ %t180 = call core.sub(%t178, %t179) :: float
259
+ yield %t180
443
260
  end_loop
444
261
  )
445
- (Declaration hi_ms
446
- %t293 = load_input "fed" :: array
447
- %t294 = load_field t293["married_separate"] :: any
448
- %t295 = load_field t294["rates"] :: any
449
- loop rates id=L18 in %t295 as el=%rates_el_296, idx=%rates_i_297
450
- %t298 = load_field rates_el_296["hi"] :: float
451
- yield %t298
452
- end_loop
453
- )
454
- (Declaration rate_ms
455
- %t299 = load_input "fed" :: array
456
- %t300 = load_field t299["married_separate"] :: any
457
- %t301 = load_field t300["rates"] :: any
458
- loop rates id=L19 in %t301 as el=%rates_el_302, idx=%rates_i_303
459
- %t304 = load_field rates_el_302["rate"] :: float
460
- yield %t304
461
- end_loop
462
- )
463
- (Declaration hi_ms_eff
464
- %t305 = load_input "fed" :: array
465
- %t306 = load_field t305["married_separate"] :: any
466
- %t307 = load_field t306["rates"] :: any
467
- loop rates id=L20 in %t307 as el=%rates_el_308, idx=%rates_i_309
468
- %t310 = load_decl hi_ms axes=[rates] :: float
469
- %t311 = const -1 :: integer
470
- %t312 = call core.eq(%t310, %t311) :: boolean
471
- %t313 = const 100000000000.0 :: float
472
- %t314 = load_decl hi_ms axes=[rates] :: float
473
- %t315 = select %t312, %t313, %t314 :: float
474
- yield %t315
475
- end_loop
476
- )
477
- (Declaration amt_ms
478
- %t316 = load_input "fed" :: array
479
- %t317 = load_field t316["married_separate"] :: any
480
- %t318 = load_field t317["rates"] :: any
481
- %t321 = load_decl taxable_ms :: float
482
- loop rates id=L21 in %t318 as el=%rates_el_319, idx=%rates_i_320
483
- %t322 = load_decl lo_ms axes=[rates] :: float
484
- %t323 = call core.sub(%t321, %t322) :: float
485
- %t324 = const 0 :: integer
486
- %t325 = load_decl hi_ms_eff axes=[rates] :: float
487
- %t326 = load_decl lo_ms axes=[rates] :: float
488
- %t327 = call core.sub(%t325, %t326) :: float
489
- %t328 = call core.clamp(%t323, %t324, %t327) :: float
490
- yield %t328
491
- end_loop
492
- )
493
- (Declaration fed_tax_ms
494
- %acc_329 = decl_acc :: float
495
- %t330 = load_input "fed" :: array
496
- %t331 = load_field t330["married_separate"] :: any
497
- %t332 = load_field t331["rates"] :: any
498
- loop rates id=L22 in %t332 as el=%rates_el_333, idx=%rates_i_334
499
- %t335 = load_decl amt_ms axes=[rates] :: float
500
- %t336 = load_decl rate_ms axes=[rates] :: float
501
- %t337 = call core.mul(%t335, %t336) :: float
502
- %acc_329 = acc_add agg.sum(%acc_329, %t337) :: float
503
- end_loop
504
- %t338 = acc_load %acc_329 :: float
505
- yield %t338
506
- )
507
- (Declaration in_br_ms
508
- %t339 = load_input "fed" :: array
509
- %t340 = load_field t339["married_separate"] :: any
510
- %t341 = load_field t340["rates"] :: any
511
- %t344 = load_decl taxable_ms :: float
512
- %t347 = load_decl taxable_ms :: float
513
- loop rates id=L23 in %t341 as el=%rates_el_342, idx=%rates_i_343
514
- %t345 = load_decl lo_ms axes=[rates] :: float
515
- %t346 = call core.gte(%t344, %t345) :: boolean
516
- %t348 = load_decl hi_ms_eff axes=[rates] :: float
517
- %t349 = call core.lt(%t347, %t348) :: boolean
518
- %t350 = call core.and(%t346, %t349) :: boolean
519
- yield %t350
520
- end_loop
521
- )
522
- (Declaration fed_marginal_ms
523
- %acc_351 = decl_acc :: float
524
- %t352 = load_input "fed" :: array
525
- %t353 = load_field t352["married_separate"] :: any
526
- %t354 = load_field t353["rates"] :: any
527
- loop rates id=L24 in %t354 as el=%rates_el_355, idx=%rates_i_356
528
- %t357 = load_decl in_br_ms axes=[rates] :: boolean
529
- %t358 = load_decl rate_ms axes=[rates] :: float
530
- %t359 = const 0 :: integer
531
- %t360 = select %t357, %t358, %t359 :: float
532
- %acc_351 = acc_add agg.sum(%acc_351, %t360) :: float
533
- end_loop
534
- %t361 = acc_load %acc_351 :: float
535
- yield %t361
536
- )
537
- (Declaration fed_eff_ms
538
- %t362 = load_decl fed_tax_ms :: float
539
- %t363 = load_input "income" :: float
540
- %t364 = const 1.0 :: float
541
- %t365 = make_tuple(%t363, %t364) :: tuple<float>
542
- %t366 = fold %t365 fn="agg.max" :: float
543
- %t367 = call core.div(%t362, %t366) :: float
544
- yield %t367
545
- )
546
- (Declaration ss_tax_ms
547
- %t368 = load_decl ss_tax_s :: float
548
- yield %t368
549
- )
550
- (Declaration med_tax_ms
551
- %t369 = load_decl med_tax_s :: float
552
- yield %t369
553
- )
554
- (Declaration addl_threshold_ms
555
- %t370 = const 125000.0 :: float
556
- yield %t370
557
- )
558
- (Declaration addl_med_tax_ms
559
- %t371 = load_input "income" :: float
560
- %t372 = const 125000.0 :: float
561
- %t373 = call core.sub(%t371, %t372) :: float
562
- %t374 = const 0 :: integer
563
- %t375 = make_tuple(%t373, %t374) :: tuple<float, integer>
564
- %t376 = fold %t375 fn="agg.max" :: float
565
- %t377 = const 0.009 :: float
566
- %t378 = call core.mul(%t376, %t377) :: float
567
- yield %t378
568
- )
569
- (Declaration fica_tax_ms
570
- %t379 = load_decl ss_tax_ms :: float
571
- %t380 = load_decl med_tax_ms :: float
572
- %t381 = call core.add(%t379, %t380) :: float
573
- %t382 = load_decl addl_med_tax_ms :: float
574
- %t383 = call core.add(%t381, %t382) :: float
575
- yield %t383
576
- )
577
- (Declaration fica_eff_ms
578
- %t384 = load_decl fica_tax_ms :: float
579
- %t385 = load_input "income" :: float
580
- %t386 = const 1.0 :: float
581
- %t387 = make_tuple(%t385, %t386) :: tuple<float>
582
- %t388 = fold %t387 fn="agg.max" :: float
583
- %t389 = call core.div(%t384, %t388) :: float
584
- yield %t389
585
- )
586
- (Declaration total_tax_ms
587
- %t390 = load_decl fed_tax_ms :: float
588
- %t391 = load_decl fica_tax_ms :: float
589
- %t392 = call core.add(%t390, %t391) :: float
590
- %t393 = load_decl state_tax :: float
591
- %t394 = call core.add(%t392, %t393) :: float
592
- %t395 = load_decl local_tax :: float
593
- %t396 = call core.add(%t394, %t395) :: float
594
- yield %t396
595
- )
596
- (Declaration total_eff_ms
597
- %t397 = load_decl total_tax_ms :: float
598
- %t398 = load_input "income" :: float
599
- %t399 = const 1.0 :: float
600
- %t400 = make_tuple(%t398, %t399) :: tuple<float>
601
- %t401 = fold %t400 fn="agg.max" :: float
602
- %t402 = call core.div(%t397, %t401) :: float
603
- yield %t402
604
- )
605
- (Declaration after_tax_ms
606
- %t403 = load_input "income" :: float
607
- %t404 = load_decl total_tax_ms :: float
608
- %t405 = call core.sub(%t403, %t404) :: float
609
- yield %t405
610
- )
611
- (Declaration take_home_ms
612
- %t406 = load_decl after_tax_ms :: float
613
- %t407 = load_input "retirement_contrib" :: float
614
- %t408 = call core.sub(%t406, %t407) :: float
615
- yield %t408
616
- )
617
- (Declaration taxable_hoh
618
- %t409 = load_input "income" :: float
619
- %t410 = load_input "fed" :: any
620
- %t411 = load_field t410["head_of_household"] :: any
621
- %t412 = load_field t411["std"] :: float
622
- %t413 = call core.sub(%t409, %t412) :: float
623
- %t414 = const 0 :: integer
624
- %t415 = make_tuple(%t413, %t414) :: tuple<float, integer>
625
- %t416 = fold %t415 fn="agg.max" :: float
626
- yield %t416
627
- )
628
- (Declaration lo_h
629
- %t417 = load_input "fed" :: array
630
- %t418 = load_field t417["head_of_household"] :: any
631
- %t419 = load_field t418["rates"] :: any
632
- loop rates id=L25 in %t419 as el=%rates_el_420, idx=%rates_i_421
633
- %t422 = load_field rates_el_420["lo"] :: float
634
- yield %t422
635
- end_loop
636
- )
637
- (Declaration hi_h
638
- %t423 = load_input "fed" :: array
639
- %t424 = load_field t423["head_of_household"] :: any
640
- %t425 = load_field t424["rates"] :: any
641
- loop rates id=L26 in %t425 as el=%rates_el_426, idx=%rates_i_427
642
- %t428 = load_field rates_el_426["hi"] :: float
643
- yield %t428
644
- end_loop
645
- )
646
- (Declaration rate_h
647
- %t429 = load_input "fed" :: array
648
- %t430 = load_field t429["head_of_household"] :: any
649
- %t431 = load_field t430["rates"] :: any
650
- loop rates id=L27 in %t431 as el=%rates_el_432, idx=%rates_i_433
651
- %t434 = load_field rates_el_432["rate"] :: float
652
- yield %t434
653
- end_loop
654
- )
655
- (Declaration hi_h_eff
656
- %t435 = load_input "fed" :: array
657
- %t436 = load_field t435["head_of_household"] :: any
658
- %t437 = load_field t436["rates"] :: any
659
- loop rates id=L28 in %t437 as el=%rates_el_438, idx=%rates_i_439
660
- %t440 = load_decl hi_h axes=[rates] :: float
661
- %t441 = const -1 :: integer
662
- %t442 = call core.eq(%t440, %t441) :: boolean
663
- %t443 = const 100000000000.0 :: float
664
- %t444 = load_decl hi_h axes=[rates] :: float
665
- %t445 = select %t442, %t443, %t444 :: float
666
- yield %t445
667
- end_loop
668
- )
669
- (Declaration amt_h
670
- %t446 = load_input "fed" :: array
671
- %t447 = load_field t446["head_of_household"] :: any
672
- %t448 = load_field t447["rates"] :: any
673
- %t451 = load_decl taxable_hoh :: float
674
- loop rates id=L29 in %t448 as el=%rates_el_449, idx=%rates_i_450
675
- %t452 = load_decl lo_h axes=[rates] :: float
676
- %t453 = call core.sub(%t451, %t452) :: float
677
- %t454 = const 0 :: integer
678
- %t455 = load_decl hi_h_eff axes=[rates] :: float
679
- %t456 = load_decl lo_h axes=[rates] :: float
680
- %t457 = call core.sub(%t455, %t456) :: float
681
- %t458 = call core.clamp(%t453, %t454, %t457) :: float
682
- yield %t458
683
- end_loop
684
- )
685
- (Declaration fed_tax_hoh
686
- %acc_459 = decl_acc :: float
687
- %t460 = load_input "fed" :: array
688
- %t461 = load_field t460["head_of_household"] :: any
689
- %t462 = load_field t461["rates"] :: any
690
- loop rates id=L30 in %t462 as el=%rates_el_463, idx=%rates_i_464
691
- %t465 = load_decl amt_h axes=[rates] :: float
692
- %t466 = load_decl rate_h axes=[rates] :: float
693
- %t467 = call core.mul(%t465, %t466) :: float
694
- %acc_459 = acc_add agg.sum(%acc_459, %t467) :: float
695
- end_loop
696
- %t468 = acc_load %acc_459 :: float
697
- yield %t468
698
- )
699
- (Declaration in_br_h
700
- %t469 = load_input "fed" :: array
701
- %t470 = load_field t469["head_of_household"] :: any
702
- %t471 = load_field t470["rates"] :: any
703
- %t474 = load_decl taxable_hoh :: float
704
- %t477 = load_decl taxable_hoh :: float
705
- loop rates id=L31 in %t471 as el=%rates_el_472, idx=%rates_i_473
706
- %t475 = load_decl lo_h axes=[rates] :: float
707
- %t476 = call core.gte(%t474, %t475) :: boolean
708
- %t478 = load_decl hi_h_eff axes=[rates] :: float
709
- %t479 = call core.lt(%t477, %t478) :: boolean
710
- %t480 = call core.and(%t476, %t479) :: boolean
711
- yield %t480
712
- end_loop
713
- )
714
- (Declaration fed_marginal_hoh
715
- %acc_481 = decl_acc :: float
716
- %t482 = load_input "fed" :: array
717
- %t483 = load_field t482["head_of_household"] :: any
718
- %t484 = load_field t483["rates"] :: any
719
- loop rates id=L32 in %t484 as el=%rates_el_485, idx=%rates_i_486
720
- %t487 = load_decl in_br_h axes=[rates] :: boolean
721
- %t488 = load_decl rate_h axes=[rates] :: float
722
- %t489 = const 0 :: integer
723
- %t490 = select %t487, %t488, %t489 :: float
724
- %acc_481 = acc_add agg.sum(%acc_481, %t490) :: float
725
- end_loop
726
- %t491 = acc_load %acc_481 :: float
727
- yield %t491
728
- )
729
- (Declaration fed_eff_hoh
730
- %t492 = load_decl fed_tax_hoh :: float
731
- %t493 = load_input "income" :: float
732
- %t494 = const 1.0 :: float
733
- %t495 = make_tuple(%t493, %t494) :: tuple<float>
734
- %t496 = fold %t495 fn="agg.max" :: float
735
- %t497 = call core.div(%t492, %t496) :: float
736
- yield %t497
737
- )
738
- (Declaration ss_tax_h
739
- %t498 = load_decl ss_tax_s :: float
740
- yield %t498
741
- )
742
- (Declaration med_tax_h
743
- %t499 = load_decl med_tax_s :: float
744
- yield %t499
745
- )
746
- (Declaration addl_threshold_hoh
747
- %t500 = const 200000.0 :: float
748
- yield %t500
749
- )
750
- (Declaration addl_med_tax_h
751
- %t501 = load_input "income" :: float
752
- %t502 = const 200000.0 :: float
753
- %t503 = call core.sub(%t501, %t502) :: float
754
- %t504 = const 0 :: integer
755
- %t505 = make_tuple(%t503, %t504) :: tuple<float, integer>
756
- %t506 = fold %t505 fn="agg.max" :: float
757
- %t507 = const 0.009 :: float
758
- %t508 = call core.mul(%t506, %t507) :: float
759
- yield %t508
760
- )
761
- (Declaration fica_tax_hoh
762
- %t509 = load_decl ss_tax_h :: float
763
- %t510 = load_decl med_tax_h :: float
764
- %t511 = call core.add(%t509, %t510) :: float
765
- %t512 = load_decl addl_med_tax_h :: float
766
- %t513 = call core.add(%t511, %t512) :: float
767
- yield %t513
768
- )
769
- (Declaration fica_eff_hoh
770
- %t514 = load_decl fica_tax_hoh :: float
771
- %t515 = load_input "income" :: float
772
- %t516 = const 1.0 :: float
773
- %t517 = make_tuple(%t515, %t516) :: tuple<float>
774
- %t518 = fold %t517 fn="agg.max" :: float
775
- %t519 = call core.div(%t514, %t518) :: float
776
- yield %t519
777
- )
778
- (Declaration total_tax_hoh
779
- %t520 = load_decl fed_tax_hoh :: float
780
- %t521 = load_decl fica_tax_hoh :: float
781
- %t522 = call core.add(%t520, %t521) :: float
782
- %t523 = load_decl state_tax :: float
783
- %t524 = call core.add(%t522, %t523) :: float
784
- %t525 = load_decl local_tax :: float
785
- %t526 = call core.add(%t524, %t525) :: float
786
- yield %t526
787
- )
788
- (Declaration total_eff_hoh
789
- %t527 = load_decl total_tax_hoh :: float
790
- %t528 = load_input "income" :: float
791
- %t529 = const 1.0 :: float
792
- %t530 = make_tuple(%t528, %t529) :: tuple<float>
793
- %t531 = fold %t530 fn="agg.max" :: float
794
- %t532 = call core.div(%t527, %t531) :: float
795
- yield %t532
796
- )
797
- (Declaration after_tax_hoh
798
- %t533 = load_input "income" :: float
799
- %t534 = load_decl total_tax_hoh :: float
800
- %t535 = call core.sub(%t533, %t534) :: float
801
- yield %t535
802
- )
803
- (Declaration take_home_hoh
804
- %t536 = load_decl after_tax_hoh :: float
805
- %t537 = load_input "retirement_contrib" :: float
806
- %t538 = call core.sub(%t536, %t537) :: float
807
- yield %t538
808
- )
809
262
  (Declaration summary
810
- %t539 = load_decl fed_marginal_single :: float
811
- %t540 = load_decl fed_eff_single :: float
812
- %t541 = load_decl fed_tax_single :: float
813
- %t542 = make_object{marginal: %t539, effective: %t540, tax: %t541} :: object
814
- %t543 = load_decl fica_eff_single :: float
815
- %t544 = load_decl fica_tax_single :: float
816
- %t545 = make_object{effective: %t543, tax: %t544} :: object
817
- %t546 = load_input "state_rate" :: float
818
- %t547 = load_input "state_rate" :: float
819
- %t548 = load_decl state_tax :: float
820
- %t549 = make_object{marginal: %t546, effective: %t547, tax: %t548} :: object
821
- %t550 = load_input "local_rate" :: float
822
- %t551 = load_input "local_rate" :: float
823
- %t552 = load_decl local_tax :: float
824
- %t553 = make_object{marginal: %t550, effective: %t551, tax: %t552} :: object
825
- %t554 = load_decl total_eff_single :: float
826
- %t555 = load_decl total_tax_single :: float
827
- %t556 = make_object{effective: %t554, tax: %t555} :: object
828
- %t557 = load_decl after_tax_single :: float
829
- %t558 = load_input "retirement_contrib" :: float
830
- %t559 = load_decl take_home_single :: float
831
- %t560 = make_object{federal: %t542, fica: %t545, state: %t549, local: %t553, total: %t556, after_tax: %t557, retirement_contrib: %t558, take_home: %t559} :: object
832
- %t561 = load_decl fed_marginal_mj :: float
833
- %t562 = load_decl fed_eff_mj :: float
834
- %t563 = load_decl fed_tax_mj :: float
835
- %t564 = make_object{marginal: %t561, effective: %t562, tax: %t563} :: object
836
- %t565 = load_decl fica_eff_mj :: float
837
- %t566 = load_decl fica_tax_mj :: float
838
- %t567 = make_object{effective: %t565, tax: %t566} :: object
839
- %t568 = load_input "state_rate" :: float
840
- %t569 = load_input "state_rate" :: float
841
- %t570 = load_decl state_tax :: float
842
- %t571 = make_object{marginal: %t568, effective: %t569, tax: %t570} :: object
843
- %t572 = load_input "local_rate" :: float
844
- %t573 = load_input "local_rate" :: float
845
- %t574 = load_decl local_tax :: float
846
- %t575 = make_object{marginal: %t572, effective: %t573, tax: %t574} :: object
847
- %t576 = load_decl total_eff_mj :: float
848
- %t577 = load_decl total_tax_mj :: float
849
- %t578 = make_object{effective: %t576, tax: %t577} :: object
850
- %t579 = load_decl after_tax_mj :: float
851
- %t580 = load_input "retirement_contrib" :: float
852
- %t581 = load_decl take_home_mj :: float
853
- %t582 = make_object{federal: %t564, fica: %t567, state: %t571, local: %t575, total: %t578, after_tax: %t579, retirement_contrib: %t580, take_home: %t581} :: object
854
- %t583 = load_decl fed_marginal_ms :: float
855
- %t584 = load_decl fed_eff_ms :: float
856
- %t585 = load_decl fed_tax_ms :: float
857
- %t586 = make_object{marginal: %t583, effective: %t584, tax: %t585} :: object
858
- %t587 = load_decl fica_eff_ms :: float
859
- %t588 = load_decl fica_tax_ms :: float
860
- %t589 = make_object{effective: %t587, tax: %t588} :: object
861
- %t590 = load_input "state_rate" :: float
862
- %t591 = load_input "state_rate" :: float
863
- %t592 = load_decl state_tax :: float
864
- %t593 = make_object{marginal: %t590, effective: %t591, tax: %t592} :: object
865
- %t594 = load_input "local_rate" :: float
866
- %t595 = load_input "local_rate" :: float
867
- %t596 = load_decl local_tax :: float
868
- %t597 = make_object{marginal: %t594, effective: %t595, tax: %t596} :: object
869
- %t598 = load_decl total_eff_ms :: float
870
- %t599 = load_decl total_tax_ms :: float
871
- %t600 = make_object{effective: %t598, tax: %t599} :: object
872
- %t601 = load_decl after_tax_ms :: float
873
- %t602 = load_input "retirement_contrib" :: float
874
- %t603 = load_decl take_home_ms :: float
875
- %t604 = make_object{federal: %t586, fica: %t589, state: %t593, local: %t597, total: %t600, after_tax: %t601, retirement_contrib: %t602, take_home: %t603} :: object
876
- %t605 = load_decl fed_marginal_hoh :: float
877
- %t606 = load_decl fed_eff_hoh :: float
878
- %t607 = load_decl fed_tax_hoh :: float
879
- %t608 = make_object{marginal: %t605, effective: %t606, tax: %t607} :: object
880
- %t609 = load_decl fica_eff_hoh :: float
881
- %t610 = load_decl fica_tax_hoh :: float
882
- %t611 = make_object{effective: %t609, tax: %t610} :: object
883
- %t612 = load_input "state_rate" :: float
884
- %t613 = load_input "state_rate" :: float
885
- %t614 = load_decl state_tax :: float
886
- %t615 = make_object{marginal: %t612, effective: %t613, tax: %t614} :: object
887
- %t616 = load_input "local_rate" :: float
888
- %t617 = load_input "local_rate" :: float
889
- %t618 = load_decl local_tax :: float
890
- %t619 = make_object{marginal: %t616, effective: %t617, tax: %t618} :: object
891
- %t620 = load_decl total_eff_hoh :: float
892
- %t621 = load_decl total_tax_hoh :: float
893
- %t622 = make_object{effective: %t620, tax: %t621} :: object
894
- %t623 = load_decl after_tax_hoh :: float
895
- %t624 = load_input "retirement_contrib" :: float
896
- %t625 = load_decl take_home_hoh :: float
897
- %t626 = make_object{federal: %t608, fica: %t611, state: %t615, local: %t619, total: %t622, after_tax: %t623, retirement_contrib: %t624, take_home: %t625} :: object
898
- %t627 = make_object{single: %t560, married_joint: %t582, married_separate: %t604, head_of_household: %t626} :: object
899
- yield %t627
263
+ %t181 = load_input "statuses" :: array
264
+ %t194 = load_decl state_tax :: float
265
+ %t198 = load_decl local_tax :: float
266
+ loop statuses id=L26 in %t181 as el=%statuses_el_182, idx=%statuses_i_183
267
+ %t184 = load_field statuses_el_182["name"] :: string
268
+ %t185 = load_decl fed_marg axes=[statuses] :: float
269
+ %t186 = load_decl fed_eff axes=[statuses] :: float
270
+ %t187 = load_decl fed_tax axes=[statuses] :: float
271
+ %t188 = make_object{marginal: %t185, effective: %t186, tax: %t187} :: object
272
+ %t189 = load_decl fica_eff axes=[statuses] :: float
273
+ %t190 = load_decl fica_tax axes=[statuses] :: float
274
+ %t191 = make_object{effective: %t189, tax: %t190} :: object
275
+ %t192 = load_input "state_rate" :: float
276
+ %t193 = load_input "state_rate" :: float
277
+ %t195 = make_object{marginal: %t192, effective: %t193, tax: %t194} :: object
278
+ %t196 = load_input "local_rate" :: float
279
+ %t197 = load_input "local_rate" :: float
280
+ %t199 = make_object{marginal: %t196, effective: %t197, tax: %t198} :: object
281
+ %t200 = load_decl total_eff axes=[statuses] :: float
282
+ %t201 = load_decl total_tax axes=[statuses] :: float
283
+ %t202 = make_object{effective: %t200, tax: %t201} :: object
284
+ %t203 = load_decl after_tax axes=[statuses] :: float
285
+ %t204 = load_input "retirement_contrib" :: float
286
+ %t205 = load_decl take_home axes=[statuses] :: float
287
+ %t206 = make_object{filing_status: %t184, federal: %t188, fica: %t191, state: %t195, local: %t199, total: %t202, after_tax: %t203, retirement_contrib: %t204, take_home: %t205} :: object
288
+ yield %t206
289
+ end_loop
900
290
  )
901
291
  )