Generalized McMillan equation