RolfAndreassen comments on Automatic programming, an example - Less Wrong

12 Post author: Thomas 01 February 2012 08:55PM

You are viewing a comment permalink. View the original post to see all comments and the full post content.

Comments (32)

You are viewing a single comment's thread. Show more comments above.

Comment author: wmorgan 01 February 2012 10:10:13PM *  9 points [-]

The generated code is bizarre. I refactored it as well as I could, and it still doesn't make much sense:

aphelion = (aphelion + perihelion) >> 10;
aphelion = aphelion - (aphelion / 12);
guess = ( ( (aphelion | 12) * (int)sqrt(aphelion) ) ^ 12 ) / 12;

"To get the orbit time in days from the aphelion and perihelion in Kkm, first sum them and divide by 1024. Then from that, subtract one twelfth. Then, to the value, perform a bitwise OR with 0x0C, multiply by the square root, and bit-XOR 0x0C again. Finally, divide by 12, and that will give you the number of days."

Comment author: RolfAndreassen 01 February 2012 10:28:34PM 6 points [-]

This reminds me of the discussion from last week of the code that a self-modifying AI might produce; I said then that I thought people were not thinking Weirdly enough. This is indeed an example of Weirdness. Obviously no human would come up with such a thing. Yet it works, more or less; although the hardcoded numbers make me suspect that its range of applicability may not be great. Testing it on some numbers typical of, say, solar orbits around the galactic core, might produce some surprising results.

It would also be interesting to compare this for speed, as well as accuracy, with a Kepler's-law implementation.