Done! As long as I test {x, 0}
(that is, a complex number with imaginary component zero), I get exactly those tests scripted for x
in the test framework for first, second, and third order derivatives through our functionals. This exercises types int, double, var, fvar<double>, fvar<fvar<double>>, fvar<var>, fvar<fvar<var>>
. Each test case makes sure that if a function throws, it throws at each autodiff level; if it suceeds, it has to have the same value and derivatives that match finite differences for each of the above types. The base double
versions are implemented using std::complex<double>
, so we make sure they match the library implementations on each platform.