{* 财富目标算法 *}
{* p^n - 1 *}
{* b = a * p^n + m * ---------------- *}
{* p - 1 *}
{* 说明: *}
{* b: 财富目标 a: 初始余额 *}
{* p: 1 + 年回报率 / 12 *}
{* n: 储蓄年数 * 12 *}
{* m: 每月储蓄金额 *}
function CalcOneEx(AValue1, AValue2: Double; AValue3:Integer; AValue4: Double): Double;
var
a: double;
n: Double;
p: Double;
m: Double;
b: Double;
ltmpSum1: Double;
begin
Result := 0.0;
b := AValue1;
a := AValue2;
n := AValue3 * 12;
p := 1+ AValue4 / 100.0 / 12 ;
ltmpSum1 := a * Power(p, n); //初始余额复利总额
if ltmpSum1 > b then exit;
m := (b - ltmpSum1) / ((Power(p, n) - 1) / (p - 1));
Result := m;
end;