Open tpapp opened 6 years ago
This is a very good question. Currently, ForwardDiff uses finite differencing to check against its test suite, but it would be quite useful to have a more formal verification tool that could prove a target Julia program's differentiability. Testing against finite differencing is really annoying due to its approximation error.
Another possibility is complex step differentiation, https://blogs.mathworks.com/cleve/2013/10/14/complex-step-differentiation/
Suppose I write a function
f(x, y)
. Is there a recommended API for unit testing that it works (at least runs) withForwardDiff
? For example, the minimum requirement would be that it is capable of handlingDual
numbers, and returnsDual
s too (is there anything else?).Currently I am just generating arguments of random
Dual
s and then check that the return type has the same element type. But it is pretty ad hoc, and I would prefer to do the right thing.