Skip to content

SymDiff.jl provides symbolic differentiation of expressions.

License

Notifications You must be signed in to change notification settings

ahojukka5/SymDiff.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SymDiff.jl - symbolic differentiation

ci codecov docs-stable docs-dev

Package author: Jukka Aho (@ahojukka5)

SymDiff.jl is a small package demonstrating how one can do expression manipulations using Julia.

With the help of the package, it's possible to evaluate fast polynomials:

julia> using SymDiff

julia> f = :(2 * w^2 * u * v^2)
:(2 * w ^ 2 * u * v ^ 2)

julia> df = simplify(differentiate(f, :u))
:(2 * w ^ 2 * v ^ 2)

julia> @eval df1(u, v, w) = $df
df1 (generic function with 1 method)

julia> df2(u, v, w) = 2 * w^2 * v^2
df2 (generic function with 1 method)

julia> using BenchmarkTools

julia> @btime df1(1, 2, 3)
  0.023 ns (0 allocations: 0 bytes)
72

julia> @btime df2(1, 2, 3)
  0.025 ns (0 allocations: 0 bytes)
72

About

SymDiff.jl provides symbolic differentiation of expressions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages