[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 87ac2f8 3/8: Use product minimum for certain
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 87ac2f8 3/8: Use product minimum for certain specamt strategies |
Date: |
Tue, 25 May 2021 20:10:59 -0400 (EDT) |
branch: master
commit 87ac2f833375008d620eeaa62ed1cff5306f0d89
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Use product minimum for certain specamt strategies
---
basic_values.hpp | 7 +++++++
gpt_specamt.cpp | 10 +++++++++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/basic_values.hpp b/basic_values.hpp
index 508717a..df88841 100644
--- a/basic_values.hpp
+++ b/basic_values.hpp
@@ -145,6 +145,8 @@ class LMI_SO BasicValues
currency GetAnnualTgtPrem(int a_year, currency a_specamt) const;
+ currency min_issue_spec_amt() const;
+
std::vector<double> const& GetCorridorFactor() const;
std::vector<double> const& GetMlyDcvqc() const;
@@ -534,6 +536,11 @@ inline mcenum_state BasicValues::GetPremiumTaxState() const
return PremiumTaxState_;
}
+inline currency BasicValues::min_issue_spec_amt() const
+{
+ return MinIssSpecAmt;
+}
+
// IHS !! Use a configuration file instead. These deprecated
// functions are used only by the antediluvian branch.
char const* CurrentTableFile();
diff --git a/gpt_specamt.cpp b/gpt_specamt.cpp
index 613af48..02b0c21 100644
--- a/gpt_specamt.cpp
+++ b/gpt_specamt.cpp
@@ -157,8 +157,16 @@ currency gpt_specamt::CalculateSpecAmt
);
// No amount solved for can plausibly reach one billion dollars.
+ // No amount lower than the product's minimum should be used.
+ //
+ // AccountValue::Solve() case 'mce_solve_specamt' solves for the
+ // base specified amount, whereas this function sets the total;
+ // their minimums deliberately differ. Using the lower minimum
+ // might violate the "total" minimum for a product with a term
+ // rider; that's okay when the user requests a solve, but not for
+ // the strategy implemented here, which should work more robustly.
decimal_root
- (0.0
+ (dblize(a_Values.min_issue_spec_amt())
,999999999.99
,bias_higher
,z.round_min_specamt.decimals()
- [lmi-commits] [lmi] master updated (ad8e4f7 -> f9d13e6), Greg Chicares, 2021/05/25
- [lmi-commits] [lmi] master 0100f71 2/8: Expunge a footling defect marker [281], Greg Chicares, 2021/05/25
- [lmi-commits] [lmi] master 1966a5d 1/8: Force InitBaseSpecAmt to equal SpecAmt.front(), Greg Chicares, 2021/05/25
- [lmi-commits] [lmi] master 87ac2f8 3/8: Use product minimum for certain specamt strategies,
Greg Chicares <=
- [lmi-commits] [lmi] master 2282f65 7/8: Explain an alteration of Brent's algorithm, Greg Chicares, 2021/05/25
- [lmi-commits] [lmi] master e85193a 6/8: Clarify, Greg Chicares, 2021/05/25
- [lmi-commits] [lmi] master 83a7960 5/8: Eliminate a side-effect guarantee [280], Greg Chicares, 2021/05/25
- [lmi-commits] [lmi] master f9d13e6 8/8: Refactor, Greg Chicares, 2021/05/25
- [lmi-commits] [lmi] master 17b7458 4/8: Eliminate the only use of a side-effect guarantee, Greg Chicares, 2021/05/25