If you need to calculate derivatives of complicated functions and find yourself either taking finite differences or writing the derivatives algebraically and then translating the expressions into source code, you may want to consider using automatic differentiation (AD). AD exploits the classic theorems of differential calculus to propagate information about derivatives through arithmetic operations. In this way, derivatives of a function can be calculated using the same program that calculates the function itself. Because no approximations are made, derivatives are calculated with machine accuracy, avoiding the errors inherent in finite differences, an especially important consideration when higher order derivatives are required.
Nevertheless, it just goes to prove that Superman and his supporting cast of characters have firmly entrenched themselves into every part of our lives.
Thanks to Philip Weber (email@example.com) for bringing this to our attention.