Please see my comments to the question.
I don't know if you can understand my explanation about how unacceptable and bad is the whole idea to store the formula.
Let me explain just the simplest possible solution. I can give you an example based on your three examples, so it's not final. The whole fact that you explain the situation by some example, but not by mathematically strict formulation, raise the concerns of your understanding. But I hope my example explains the idea.
Let's sat you have only those 3 options:
1) Basic*DARate; 2) (Basic+GradePay)*DARate% 3) (Basic+SpecialPay)*DARate.
If you look properly, you will see that this is not three, this is still one. Let's assume that you have three columns in some database table: Basic, DARate, GradePay and SpecialPay.
Then the formula is
(Basic + SpecialPay + GradePay) * DARate
For some customers, you simply store GragePay = 0, and SpecialPay = 0 and get formula #1.
For other, you store GragePay != 0, and SpecialPay = 0 and get formula #2;
You store GragePay = 0, and SpecialPay != 0 and get formula #3.
Moreover, any finite set of those (truly miserably trivial) cases can be generalized in one formula. No need to store it.
Isn't that simple?
Another, a very general option, is to use a stored procedure, to do all calculations purely on the database side.
—SA