jimrandomh 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: Thomas 02 February 2012 05:28:46PM *  2 points [-]

No. The posted code has a bit shift right for 12 places. The already optimized code by wmorgan has a bit shift for only 10 bits.

The metacommand $RESCOM if while val_operation inc_dec caused this. Having two constants (10 and 12) would be undesirable be cause of this "val_operation" and therefore only the constant 12 was used.

Comment author: jimrandomh 02 February 2012 07:13:33PM 1 point [-]

The extra two places of bit shifting cancel with two previous self-additions.

Comment author: Thomas 02 February 2012 07:29:21PM 1 point [-]

I know and I agree with this.

Then you have two different constants (10 and 12). One for the shifting and another for the division. It's nothing wrong with that, but the simulator was prevented to have more constants then absolutely necessary. So everything was done with the "12" and I was discussing that.