lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master d810c2d 2/2: Rework enforcement of minimum si


From: Greg Chicares
Subject: [lmi-commits] [lmi] master d810c2d 2/2: Rework enforcement of minimum single premium
Date: Thu, 22 Apr 2021 16:26:32 -0400 (EDT)

branch: master
commit d810c2d30af886929372ce3e3a0c36806c815a2c
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Rework enforcement of minimum single premium
    
    The last commit detected problems only with a "corridor" strategy.
    Replaced it with a simpler reimplementation at a higher level.
---
 ihs_avmly.cpp    | 34 ++++++++++++++++++++++++++++++++++
 ihs_avstrtgy.cpp | 55 -------------------------------------------------------
 2 files changed, 34 insertions(+), 55 deletions(-)

diff --git a/ihs_avmly.cpp b/ihs_avmly.cpp
index 9b8dc7c..f1e1428 100644
--- a/ihs_avmly.cpp
+++ b/ihs_avmly.cpp
@@ -1256,6 +1256,40 @@ void AccountValue::TxAscertainDesiredPayment()
             }
         EeGrossPmts[Month] += Dumpin;
         GrossPmts  [Month] += Dumpin;
+
+        if
+            (  !Solving
+            && oe_min_single_premium_corr_mult == MinSinglePremiumType
+            && !global_settings::instance().regression_testing()
+            )
+            {
+            double special_min_prem =
+                MinSinglePremiumMult
+                * ActualSpecAmt
+                / GetCorridorFactor()[0]
+                ;
+            if(dblize(GrossPmts[Month]) < special_min_prem)
+                {
+                alarum()
+                    << std::fixed
+                    << "Premium "
+                    << std::setprecision(2)
+                    << GrossPmts[Month]
+                    << " is less than "
+                    << std::setprecision(7)
+                    << special_min_prem
+                    << std::setprecision(2)
+                    << " minimum for "
+                    << ActualSpecAmt
+                    << " specified amount with "
+                    << GetCorridorFactor()[0]
+                    << " corridor factor for insured '"
+                    << yare_input_.InsuredName
+                    << "'."
+                    << std::flush
+                    ;
+                }
+            }
         }
 
     assert_pmts_add_up(__FILE__, __LINE__, Month);
diff --git a/ihs_avstrtgy.cpp b/ihs_avstrtgy.cpp
index 65e6542..0fccc60 100644
--- a/ihs_avstrtgy.cpp
+++ b/ihs_avstrtgy.cpp
@@ -30,8 +30,6 @@
 #include "outlay.hpp"
 
 #include <algorithm>
-#include <cmath>                        // ceil()
-#include <iomanip>
 #include <utility>
 
 /// Set specamt according to selected strategy in a non-solve year.
@@ -147,59 +145,6 @@ void AccountValue::PerformSpecAmtStrategy()
             strategy = mce_sa_input_scalar;
             }
         currency z = CalculateSpecAmtFromStrategy(j, 0, explicit_value, 
strategy);
-        if
-            (  0 == j
-            && yare_input_.EffectiveDate == yare_input_.InforceAsOfDate
-            && oe_min_single_premium_corr_mult == MinSinglePremiumType
-            && mce_sa_corridor == strategy
-            && !Solving
-            )
-            {
-            // SOMEDAY !! Duplicated above--refactor.
-            currency annualized_pmt =
-                    Outlay_->ee_premium_modes ()[0]
-                  * Outlay_->ee_modal_premiums()[0]
-                +   Outlay_->er_premium_modes ()[0]
-                  * Outlay_->er_modal_premiums()[0]
-                ;
-            double special_spec_amt =
-                  annualized_pmt
-                * GetCorridorFactor()[0]
-                / MinSinglePremiumMult
-                ;
-            // "0.01 + ": err on the conservative side for finicky users
-            double special_min_prem = std::ceil
-                (0.01 + MinSinglePremiumMult * m / (GetCorridorFactor()[0])
-                );
-            if(special_spec_amt < dblize(m))
-                {
-                alarum()
-                    << std::fixed << std::setprecision(2)
-                    << "For insured '"
-                    << yare_input_.InsuredName
-                    << "', premium "
-                    << annualized_pmt
-                    << " would correspond to a specified amount of "
-                    << std::setprecision(12)
-                    << special_spec_amt
-                    << std::setprecision(2)
-                    << ", which is premium "
-                    << annualized_pmt
-                    << " times corridor factor "
-                    << GetCorridorFactor()[0]
-                    << " divided by "
-                    << MinSinglePremiumMult
-                    << ", but "
-                    << m
-                    << " is the product's minimum specified amount."
-                    << " If the client is willing to pay more, a premium of "
-                    << std::setprecision(0)
-                    << special_min_prem
-                    << " would satisfy that product rule."
-                    << std::flush
-                    ;
-                }
-            }
         DeathBfts_->set_specamt(std::max(m, z), j, 1 + j);
         if
             (  j == InforceYear



reply via email to

[Prev in Thread] Current Thread [Next in Thread]