Skip to content

ErikQQY/ComplexDiff.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ComplexDiff.jl

Stable Dev Build Status Coverage

ComplexDiff.jl fully utilize the complex step differentiation to compute accurate and high order derivative.

Get start

pkg> add ComplexDiff

High precision derivative computing

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

Jacobian and Hessian

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

References

If you are also interested in Complex Step Differentiation, please see the following papers: