I was wondering if it is possible to apply boost's automatic differentiation library:
#include <boost/math/differentiation/autodiff.hpp>
to functions which return std::complex<double> values?
For instance, consider the multivariate complex valued function:
#include <complex>
std::complex<double> complex_function(double a, double c){
// Assuming a < 0
return exp(sqrt(std::complex(a, 0.0))) + sin(c);
}
How can I take the derivative wrt to a or c using Boost's autodiff? Is that even possible?