Macros for auto-diff.