How Does Automatic Differentiation Work