1. A computing system, comprising a processor; and a memory in communication with the processor, the memory comprising instructions executable with the processor, the instructions comprising: a first programmatic function written in a formal language; and an automatic differentiation (AD) application programmer Interface (API) configured to accept the first programmatic function as an input argument and to return a second programmatic function as an output object based on a source-to-source transformation of the first programmatic function, wherein the second programmatic function is configured to calculate the derivative of the first programmatic function when executed, wherein the AD API is implemented by reflection, and wherein the first programmatic function, the AD API, and the second programmatic function returned by the AD API are invokable by a program at run-time.