FADBAD 利用 C 的模板和操作符重载的方法实现了 forward, backward and Taylor 方法。
These AD-templates enable the user to differentiate functions that are implemented in arithmetic types, such as doubles and intervals. One of the major ideas in FADBAD is that the AD-template types also behave like arithmetic types. This property of the AD-templates enables the user to differentiate a C function by replacing all occurrences of the original arithmetic type with the AD-template version. This transparency of behavior also makes it possible to generate high order derivatives by applying the AD- templates on themselves, enabling the user to combine the AD methods very easily.