The three problems with the code are that the variable names are all lies, there’s a bunch of redundant rescaling which isn’t consolidated because it’s done in integer math when it should be floating point, and there are a couple bits of overfitting (bitwise operators) that don’t belong. If you convert to SSA and wipe out the misleading names, you get:
If you replace the overfitting with pass-throughs (a6=a5, a8=a7), then pretend it’s floating point so that you can consolidate all the rescaling into a single multiplicative constant, you get
guess = k * (perihelion+aphelion)*sqrt(perihelion+aphelion)
The three problems with the code are that the variable names are all lies, there’s a bunch of redundant rescaling which isn’t consolidated because it’s done in integer math when it should be floating point, and there are a couple bits of overfitting (bitwise operators) that don’t belong. If you convert to SSA and wipe out the misleading names, you get:
If you replace the overfitting with pass-throughs (a6=a5, a8=a7), then pretend it’s floating point so that you can consolidate all the rescaling into a single multiplicative constant, you get
Which is Kepler’s third law.