90 real(kind=rk),
intent(in) :: val
91 real(kind=rk),
intent(in) :: brackets(:)
93 if (val <= brackets(1))
then
95 else if (val >= brackets(
size(brackets)))
then
99 do i=
size(brackets, kind=ik)-1_ik,1_ik,-1_ik
100 if (val > brackets(i))
then
113 real(kind=rk)
function tax(val, breaks, rates)
114 real(kind=rk),
intent(in) :: val
115 real(kind=rk),
intent(in) :: breaks(:), rates(:)
116 real(kind=rk) :: val_in_bracket, last_break, cur_break
123 do idx=1,
size(rates)-1
124 cur_break = breaks(idx)
125 val_in_bracket = min(val, cur_break) - last_break
126 last_break = cur_break
127 if (val_in_bracket > 0)
then
131 if (val >= breaks(
size(breaks)))
then
113 real(kind=rk)
function tax(val, breaks, rates)
…
143 real(kind=rk),
intent(in) :: val
144 real(kind=rk),
intent(in) :: breaks(:), rates(:)
158 real(kind=rk),
intent(in) :: val, inflation
159 integer(kind=ik),
intent(in) :: year
160 real(kind=rk),
intent(in) :: breaks(:), rates(:)
Configuration for MRFFL (MR Fortran Finance Library).
integer, parameter, public mrfflrk
Real kind used in interfaces.
real(kind=mrfflrk), parameter, public zero_epsilon
Used to test for zero.
integer, parameter, public mrfflik
Integer kinds used in interfaces.
Simple functions for working with percentages.
elemental real(kind=rk) function, public percentage_of_total(v_total, v_part)
Compute the percentage of a total.
elemental real(kind=rk) function, public percentage_of(v, p)
Compute the percentage of a value.
Solvers for TVM problems involving lump sums, level (fixed) annuities, and geometric (growing) annuit...
real(kind=rk) pure elemental function, public fv_from_pv_n_i(pv, n, i)
compute future value from present value (pv), number of periods (n), and an intrest rate (i).
real(kind=rk), parameter, public std_tax_deduction_single
real(kind=rk), parameter, public std_tax_deduction_head
integer(kind=ik) function, public max_bracket(val, brackets)
Find the bracket val belongs in given an array of bracket end points.
real(kind=rk), dimension(7), parameter, public tax_bracket_breaks_head
real(kind=rk) function, public tax(val, breaks, rates)
Compute tax given value, bracket breaks, and bracket rates.
real(kind=rk) function, public effective_tax_rate(val, breaks, rates)
Compute effective tax rate given value, bracket breaks, and bracket rates.
real(kind=rk) function, public projected_tax(val, breaks, rates, year, inflation)
Compute projected effective tax rate with tax() by adjusting the breaks into the future for inflation...
real(kind=rk), dimension(7), parameter, public tax_bracket_breaks_separately
real(kind=rk), parameter, public std_tax_deduction_joint
real(kind=rk), dimension(7), parameter, public tax_bracket_rates
integer(kind=ik), parameter, public seed_tax_year
real(kind=rk), parameter, public std_tax_deduction_separately
real(kind=rk), dimension(7), parameter, public tax_bracket_breaks_joint
real(kind=rk), dimension(7), parameter, public tax_bracket_breaks_single