gerlero / FastForwardDiff.jl

Fast automatic derivatives of scalar functions in Julia

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FastForwardDiff.jl

Stable Dev Build Status Coverage PkgEval Aqua SciML Code Style

Fast and easy derivatives of scalar functions with forward-mode automatic differentiation.

Compared to the scalar differentiation offered by the very popular ForwardDiff.jl package, FastForwardDiff adds:

  • Efficient single-pass value and derivatives with the value_and_derivative and value_and_derivatives functions. Faster and easier than ForwardDiff's equivalent (i.e., the DiffResults API) ✅
  • Unitful.jl support. Correctly handles units in the inputs and outputs of functions ✅

Internally, it relies on the proven dual-number implementation from ForwardDiff.

Example

julia> using FastForwardDiff

julia> f(x) = x^2 + 2x + 1

julia> derivative(f, 3)
8

julia> value_and_derivative(f, 3)
(16, 8)

Documentation

  • STABLE — documentation of the most recent release
  • DEV — documentation of the in-development version

About

Fast automatic derivatives of scalar functions in Julia

License:MIT License


Languages

Language:Julia 100.0%