It's likely that the original search also used strength reduction to save a lot of cycles (effectively replacing all multiplications with additions):
https://en.wikipedia.org/wiki/Strength_reduction