It's simple (sort of).
To figure out the sugar correction needed, just take the current blood sugar, subtract 120, and divide that number by 120.
For the meal correction, divide the number of carbohydrates in the meal by 25.
If you're calculating both, just add those two together.
No calculation is needed for the long-lasting insulin. It'll always be 9.