Solve it without using inheritance and the associated polymorphism then. Since you say you know the formula involved, what's stopping you now?