ComplexDiff.jl fully utilize the complex step differentiation to compute accurate and high order derivative.
pkg> add ComplexDiff
While there are round-off error when we are using finite difference to get derivative, by using Complex Step Differentiation, we can obtain extremely high precision derivative.
julia> using ComplexDiff
julia> derivative(sin, 1, 1e-15)
0.5403023058681398
It is also very easy to compute Jacobian matrix and Hessian matrix using complex step differentiation:
julia> jacobian(sin, [1, 2, 3], 0.0000001)
3×3 Matrix{Float64}:
0.540302 0.0 0.0
0.0 -0.416147 0.0
0.0 0.0 -0.989992
If you are also interested in Complex Step Differentiation, please see the following papers: