Hitting target gravity is important to getting a good beer. The equation is pretty simple:
( OG volume * OG units - current volume * current GU ) / Extract potential
If I have a beer that should enter the fermenter at 5.0 Gallons and 70 GU (1.070) and I'm currently boiling 4.0 Gallons with a 16 GU (1.016) then I'm looking at a difference of 286 GU. If I'm using Liquid extract I divide that by 38 GU/lb (or with DME it would be 45 GU/lb):
286 GU / 38 GU/lb = 7.53 lbs of liquid extract needed
It would be handy if this was either a CLI or utility to use against a pre-built recipe.