[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits]  Fix defect introduced 20110523T1058Z (while fixing
[lmi-commits]  Fix defect introduced 20110523T1058Z (while fixing another defect)
Wed, 20 Jul 2011 22:31:32 +0000
Date: 2011-07-20 22:31:30 +0000 (Wed, 20 Jul 2011)
Fix defect introduced 20110523T1058Z (while fixing another defect)
--- lmi/trunk/ChangeLog 2011-07-07 21:38:18 UTC (rev 5222)
+++ lmi/trunk/ChangeLog 2011-07-20 22:31:30 UTC (rev 5223)
@@ -28093,3 +28093,8 @@
Upgrade to wx-2.9.2 .
+20110720T2231Z <address@hidden> 
+Fix defect introduced 20110523T1058Z (while fixing another defect).
--- lmi/trunk/premium_tax.cpp 2011-07-07 21:38:18 UTC (rev 5222)
+++ lmi/trunk/premium_tax.cpp 2011-07-20 22:31:30 UTC (rev 5223)
@@ -266,8 +266,26 @@
/// DATABASE !! The '.strata' files ought to differentiate tiered
/// premium-tax load paid by customer from rate paid by insurer.
-/// An assertion ensures that either tiered or non-tiered premium-tax
+/// Assertions ensure that either tiered or non-tiered premium-tax
/// load is zero.
+/// Tiered premium tax is always greatest on the first dollar. In the
+/// case of modal premiums, the incidence of taxation is therefore
+/// front loaded in the general case; this must be reflected because
+/// to do otherwise would overstate account value.
+/// Tax is calculated separately for the premium-tax state and the
+/// state of domicile, and the greater amount usually applies because
+/// of retaliation. If the rate is tiered in either state, then the
+/// incremental tax on any modal premium is the difference between
+/// year-to-date tax after and before the payment, with due regard to
+/// retaliation; no simpler formula can be correct in the general
+/// case. However, catastrophic cancellation occurs all too easily
+/// with this formula--for example, when a MEC is avoided by reducing
+/// one modal premium to an amount orders of magnitude lower than the
+/// year-to-date premium--so it is to be avoided where demonstrably
+/// unnecessary. A simple scalar calculation that disregards history,
+/// iff correct, is more accurate.
double premium_tax::calculate_load(double payment, stratified_charges const&
@@ -301,15 +319,20 @@
ytd_taxable_premium_ += payment;
- // 'x' is more robust, though more prone to roundoff error than
- // 'y', so 'y' is preferred iff they're materially equal.
double ytd_tax_reflecting_retaliation = std::max
double x = std::max(0.0, ytd_tax_reflecting_retaliation - ytd_load_);
double y = std::max(tax_in_tax_state, tax_in_domicile);
- double z = materially_equal(x, y) ? y : x;
+ bool no_tiering = !is_tiered_in_tax_state_ && !is_tiered_in_domicile_;
+ // SOMEDAY !! Perhaps something like
+ // double k = 10.0; // Some number somewhat greater than unity.
+ // double t = k * DBL_EPSILON * ytd_taxable_premium_ / payment;
+ // double z = no_tiering || materially_equal(x, y, t) ? y : x;
+ // would achieve better accuracy; but that must not be attempted
+ // without thorough unit testing.
+ double z = no_tiering || materially_equal(x, y) ? y : x;
ytd_load_ += z;
|[Prev in Thread]
||[Next in Thread]|
- [lmi-commits]  Fix defect introduced 20110523T1058Z (while fixing another defect),
Greg Chicares <=