The Moral equation?
All your acts can have positive and negative consequences for you and your surroundings.
In order to do a moral act you should do something that benefit others, but which does not benefit you.
A moral equation could in a simple version go like this:
Morality = Benefit to others over Time (BOT)
minus Harm to others over Time (HOT)
minus Benefit to yourself over time (BYT)
plus Harm to Yourself over Time (HYT)
Morality = BOT - HOT - BYT + HYT.
If the number is positive you have performed a moral act. The difficult task is to get the actual numbers.
The equation can be elaborated much further, for example by taking into account whether your action is consciously or unconsciously made, or if you believe you have an eternal soul or not.
This is more closely described in the book.