I have a computation that solves an implicit equation using iterative numerical methods (bisection, Brent, etc). I would like to use FiniteDifferences.jl for unit testing partials I write for ChainRulesCore.
The problem is that since the calculated function is not technically continuous, using eg central_fdm(5, 1) gives me bogus results (occasionally off by a factor of 5--10). I had some success with a high number of grid points, eg central_fdm(20, 1), but too much adaptation (eg 2 steps) makes things go bad again.
I would appreciate recommendations on how to deal with this in a robust way for unit testing. Since it is for testing, it does not have to be super-fast, just robust.