Generalizing Automatic Differentiation to Automatic Sparsity, Uncertainty, Stability, and Parallelism