3

I am maintaining an old piece of financial software. In the source code I have found an implementation of the following formula:

$$p2 \over (p1 + 1) - (p1 * p2)$$

The formula is used as part of some sort of financial tax calculation. If it is of any help, both p1 and p2 are percentages expressed as factors. For instance, if p1 represents 5% then the actual value of p1 is 0.05. In addition, I can say that p1 represents the tax percentage, whereas the meaning of p2 is not clear to me - the only thing I know is that it is another percentage.

In order to understand the meaning of p2 and what the software does (it's undocumented, of course), it might help if I understood what the formula expresses. So my question to this community: Does anyone here recognize the purpose of the formula?

Red Banana
  • 23,956
  • 20
  • 91
  • 192
herzbube
  • 133
  • 1
    Tax laws can require all sorts of strange computations. It might help if you knew which country's taxes are involved here. Then you could try asking an accountant from that country. – Robert Israel Aug 17 '15 at 21:20

1 Answers1

2

The formula rewritten as a transformation of $p_2$ looks like

$$p_2'={p_2\over 1+p_1-p_1\cdot p_2}$$

and is not immediately recognizable as a "typical" result in any particular field that I am aware of. The effect is, as you probably know, that $p_2$ is modified according to the current value of $p_1$. Moreover, this effect is that $p_2'$ is smaller than $p_2$ when $p_1\gt 0, p_2\in[0,1]$, which would be the typical case for positive tax percentages.

The formula creates the "simple" ratio and difference relationships

$${p_2\over p_2'}=1+p_1-p_1\cdot p_2\\ p_2-p_2'={p_1\cdot p_2-p_1\cdot p_2^2\over 1+p_1-p_1\cdot p_2}$$

If it were possible that the formula were "wrong" and needed to be corrected, I would guess that a term $-p_2$ was missing from the denominator, like

$$p_2''={p_2\over 1+p_1-p_2-p_1\cdot p_2}={p_2\over (1+p_1)(1-p_2)}$$

which at the very least makes for a more symmetric formula.

Otherwise, "nope, never seen that before..."

abiessu
  • 8,115
  • Thanks a lot for your input! It is indeed a possibility that the formula is "wrong" in that it does not yield the intended result. I have now got a lead, someone in the company might be able to tell me what the intended result is so that I can judge the formula's correctness. Hopefully I will know more in a couple of days. – herzbube Aug 18 '15 at 07:28
  • Sounds good. I'll be glad to update my answer based on new information as it becomes available. The missing term I suggest is only a very likely candidate because of the factorization that is possible when it is present. – abiessu Aug 18 '15 at 12:11
  • After consulting more people, nobody recognizes the output of the formula as something that is valid under Swiss tax laws. The conclusion is that the formula is probably just plain wrong. My apologies for wasting your time. – herzbube Aug 25 '15 at 11:27
  • @herzbube: no apologies necessary, sometimes a formula can be interesting to study outside of its potential usefulness. I found it fun to think about what the possibilities were for this formula, including comparisons with known forms like $(x-a)(y-b)$, etc. and trying to see what the "effective change" would be relative to the starting point. – abiessu Aug 25 '15 at 12:41