inline diffX and diffY, reduced to 1 cycle
updated flop computation