Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 873 Bytes

README.md

File metadata and controls

34 lines (25 loc) · 873 Bytes

ExDeriv

A basic symbolic differentiation library

Usage

The library takes a polynomial expression in AST form. Currently, only four operations are supported: +, -, /, *.

> import ExDeriv
> derive({:\*, :x, 5}, :x)  # d(5x)/dx = 5
5
> derive({:+, {:-, {:\*, {:/, :x, :y}, 5}, :a}, :b}, :y) # d(5x/y - a + b)/dy
{:\*, 5, {:/, {:\*, -1, :x}, {:\*, :y, :y}}}             #     = -5x/y^2

Installation

If available in Hex, the package can be installed by adding ex_deriv to your list of dependencies in mix.exs:

def deps do
  [
    {:ex_deriv, "~> 0.1.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/ex_deriv.