[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 65508e2 3/6: Refactor
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 65508e2 3/6: Refactor |
Date: |
Tue, 30 Oct 2018 18:21:42 -0400 (EDT) |
branch: master
commit 65508e278b5d7f4d57092c41878b5c1022bfbf8d
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Refactor
---
account_value.hpp | 1 -
ihs_acctval.cpp | 28 ++++++++++------------------
2 files changed, 10 insertions(+), 19 deletions(-)
diff --git a/account_value.hpp b/account_value.hpp
index 6605368..03868df 100644
--- a/account_value.hpp
+++ b/account_value.hpp
@@ -516,7 +516,6 @@ class LMI_SO AccountValue
double YearsSepAcctLoadRate;
double YearsSalesLoadRefundRate;
double YearsDacTaxLoadRate;
- double YearsCashValueEnhMult;
double MonthsPolicyFees;
double SpecAmtLoad;
diff --git a/ihs_acctval.cpp b/ihs_acctval.cpp
index 0e98744..14b596f 100644
--- a/ihs_acctval.cpp
+++ b/ihs_acctval.cpp
@@ -1187,25 +1187,18 @@ void AccountValue::set_list_bill_premium()
}
}
-//============================================================================
-// Surrender charge. Only simple multiplicative parts are implemented.
-//
-// SOMEDAY !! Table support and UL model reg formulas should be added.
-//
+/// Surrender charge.
+///
+/// The "cash value enhancement" components should be implemented as
+/// such, rather than as negative surrender charges.
+///
+/// SOMEDAY !! Table support and UL model reg formulas should be added.
+
double AccountValue::SurrChg()
{
- // We permit negative surrender-charge factors. But we don't
- // allow those factors, regardless of sign, to be multiplied by
- // negative base amounts, which would result in surrender charge
- // components having an unexpected sign.
-
- LMI_ASSERT(0.0 <= InvariantValues().SpecAmt[0]);
-
- return
- SurrChg_[Year]
- - YearsCashValueEnhMult * std::max(0.0, TotalAccountValue())
- - yare_input_.CashValueEnhancementRate[Year] * std::max(0.0,
TotalAccountValue())
- ;
+ double const x = CashValueEnhMult[Year];
+ double const y = yare_input_.CashValueEnhancementRate[Year];
+ return SurrChg_[Year] - (x + y) * std::max(0.0, TotalAccountValue());
}
//============================================================================
@@ -1611,7 +1604,6 @@ void AccountValue::SetAnnualInvariants()
YearsSepAcctLoadRate = Loads_->separate_account_load (GenBasis_)[Year];
YearsSalesLoadRefundRate= Loads_->refundable_sales_load_proportion()[Year];
YearsDacTaxLoadRate = Loads_->dac_tax_load ()[Year];
- YearsCashValueEnhMult = CashValueEnhMult[Year];
}
//============================================================================
- [lmi-commits] [lmi] master updated (61a3f73 -> f5ad6f7), Greg Chicares, 2018/10/30
- [lmi-commits] [lmi] master c2e0976 1/6: Remove weird surrender charges [357], Greg Chicares, 2018/10/30
- [lmi-commits] [lmi] master 65508e2 3/6: Refactor,
Greg Chicares <=
- [lmi-commits] [lmi] master ced2b54 5/6: Improve documentation, Greg Chicares, 2018/10/30
- [lmi-commits] [lmi] master 03424fd 2/6: Expunge obsolete surrender-charge components, Greg Chicares, 2018/10/30
- [lmi-commits] [lmi] master 70ead9b 4/6: Eradicate disused "surrender charge specified amount" concept [355], Greg Chicares, 2018/10/30
- [lmi-commits] [lmi] master f5ad6f7 6/6: Expunge disused class SurrChgRates, Greg Chicares, 2018/10/30