Convert horizontal_diff functions to intrinsic.