I have a C++ code where I use the autodiff variables available within NGSolve. In a particular part of the code, I have an autodiff variable that has to be raised to the power of a double. Like:
f = pow(a, b)
with a = Autodiff type
b = SCAL
Looking at the autodiff.hpp I see that this is not implemented somehow. Instead, I have only autodiff raised to autodiff.
I tried exp(b*log(a)) in where the * is implemented for SCAL * Autodiff but I think the issue seems to be that sometimes I have the variable ‘a’ to be zero in my code and the exception handling is somehow off in the log function.
Can you suggest an alternative or can this be added easily?