Automatic Differentiation in OCaml
codeberg.org
codeberg.org
tldr: f‘(x0)≈Im(f(x0+hi))/h
Choice of h dictates precision (less bias than doing it purely in the real domain, but still .. a nontrivial choice). And also requires your functions to be analytical - which many aren't.
Whereas autodiff is precise .