3 ms·
Forward-mode differentiation is easy to implement in C++ with templates, operator overloading, and dual numbers (https://en.wikipedia.org/wiki/Automatic_differe
by cyber_kinetist 5y ago
Forward-mode differentiation is easy to implement in C++ with templates, operator overloading, and dual numbers (https://en.wikipedia.org/wiki/Automatic_differentiation#Automatic_differentiation_using_dual_numbers https://en.wikipedia.org/wiki/Automatic_differentiation#Auto...). Some libraries such as autodiff (https://github.com/autodiff/autodiff https://github.com/autodiff/autodiff) and CppAD (https://github.com/coin-or/CppAD https://github.com/coin-or/CppAD) use this method to calculate gradients and Jacobians.