The formulas are not that simple, but here is a summary. The lobe profile gives you possible engine peak power range (6200-6600rpm for S cams) Then you determine where the bottle neck is in the system by using some fluid dynamics equations, once you find the lowest flowing region you use that flow rate to calculate the horsepower. The same combination above with ported heads and a race header would have a maximun power potential of 255hp

, but the stoch heads and SSI exhaust don't flow that high

.