Those four lines together amount to a shift 10 bits to the right, i.e., division by 1024.
I think you understand what’s going in the code. The point of my refactoring was to make something that was human-readable: something that I could describe in English. And the English for those four lines of code is “divide by 1024.” That’s what those four lines do.
$DECLAREINT aphelion perihelion dif guess temp
$RINVAR aphelion(1000,100000) perihelion(1000,100000)
$RETVAR guess
if (aphelion>guess;
temp=aphelion/guess;
aphelion=aphelion-temp;
dif=sqrt(aphelion);
//aphelion=guess|aphelion;
aphelion=aphelion*dif;
//aphelion=guess^aphelion;
guess=aphelion/guess;
$EES
As you can see, there is no $RESCOM metacommand and the two “overfit” OR and XOR lines has also been commented or neutralized. Random aphelions and perihelions are between 1 million and 100 million km now. If aphelion is greater than perihelion they are swapped first. The intermediate variable “temp” is then reset to 0 before the “Kepler segment” begins. If it wasn’t reset, the simulator would simply use it! Simulator comes out with this in the $BES-$EES section:
aphelion=perihelion+aphelion;
aphelion>>=10;
guess=12;
temp=aphelion/guess;
aphelion=aphelion-temp;
perihelion=sqrt(aphelion);
perihelion=perihelion*aphelion;
guess=perihelion/guess;
Less lines, but now two constants (10 and 12) (approximately) scale days with mega-meters here, where the Sun is this massive. Initially, it was only the 12 constant, which shifted, divided and was also a XOR argument to fit some more.
Both codes here, inside the $BES-$EES segments are exactly equivalent regarding the outputs and are a distant ancestor-descendant pair. Many million generations apart, but not very much different.
As you can see, there is no $RESCOM metacommand and the two “overfit” OR and XOR lines has also been commented or neutralized. Random aphelions and perihelions are between 1 million and 100 million km now. If aphelion is greater than perihelion they are swapped first. The intermediate variable “temp” is then reset to 0 before the “Kepler segment” begins. If it wasn’t, the simulator would simply use it!
Simulator comes out with this in the $BES-$EES section:
Less lines, but now two constants (10 and 12) (approximately) scale days and mega-meters here, where the Sun is so massive. Before, it was only the constant of 12, which shifted, divided and was also a XOR argument to fit some more.
Both codes here, inside the $BES-$EES segment are exactly equivalent regarding the output and are a distant ancestor-descendant pair. Many million generations apart.
This is the generated code segment:
Those four lines together amount to a shift 10 bits to the right, i.e., division by 1024.
I think you understand what’s going in the code. The point of my refactoring was to make something that was human-readable: something that I could describe in English. And the English for those four lines of code is “divide by 1024.” That’s what those four lines do.
We can modify the above code to:
$DECLAREINT aphelion perihelion dif guess temp $RINVAR aphelion(1000,100000) perihelion(1000,100000) $RETVAR guess if (aphelion>guess; temp=aphelion/guess; aphelion=aphelion-temp; dif=sqrt(aphelion); //aphelion=guess|aphelion; aphelion=aphelion*dif; //aphelion=guess^aphelion; guess=aphelion/guess; $EES As you can see, there is no $RESCOM metacommand and the two “overfit” OR and XOR lines has also been commented or neutralized. Random aphelions and perihelions are between 1 million and 100 million km now. If aphelion is greater than perihelion they are swapped first. The intermediate variable “temp” is then reset to 0 before the “Kepler segment” begins. If it wasn’t reset, the simulator would simply use it! Simulator comes out with this in the $BES-$EES section:
aphelion=perihelion+aphelion; aphelion>>=10; guess=12; temp=aphelion/guess; aphelion=aphelion-temp; perihelion=sqrt(aphelion); perihelion=perihelion*aphelion; guess=perihelion/guess; Less lines, but now two constants (10 and 12) (approximately) scale days with mega-meters here, where the Sun is this massive. Initially, it was only the 12 constant, which shifted, divided and was also a XOR argument to fit some more.
Both codes here, inside the $BES-$EES segments are exactly equivalent regarding the outputs and are a distant ancestor-descendant pair. Many million generations apart, but not very much different.
We can modify the above code to:
$DECLAREINT aphelion perihelion dif guess temp $RINVAR aphelion(1000,100000) perihelion(1000,100000) $RETVAR guess
if (aphelion<perihelion) { temp=perihelion; perihelion=aphelion; aphelion=temp; }
temp=0;
$BES aphelion=perihelion+aphelion; aphelion=aphelion+aphelion; aphelion=aphelion+aphelion; guess=12; aphelion=aphelion>>guess; temp=aphelion/guess; aphelion=aphelion-temp; dif=sqrt(aphelion); //aphelion=guess|aphelion; aphelion=aphelion*dif; //aphelion=guess^aphelion; guess=aphelion/guess; $EES
As you can see, there is no $RESCOM metacommand and the two “overfit” OR and XOR lines has also been commented or neutralized. Random aphelions and perihelions are between 1 million and 100 million km now. If aphelion is greater than perihelion they are swapped first. The intermediate variable “temp” is then reset to 0 before the “Kepler segment” begins. If it wasn’t, the simulator would simply use it!
Simulator comes out with this in the $BES-$EES section:
Less lines, but now two constants (10 and 12) (approximately) scale days and mega-meters here, where the Sun is so massive. Before, it was only the constant of 12, which shifted, divided and was also a XOR argument to fit some more.
Both codes here, inside the $BES-$EES segment are exactly equivalent regarding the output and are a distant ancestor-descendant pair. Many million generations apart.