Skip to content

API for high-order scalar derivatives #187

Open
@jrevels

Description

@jrevels

It'd be nice to use the existing DiffBase.DiffResult API to get higher-order scalar derivatives via derivative!.

For example, it would be cool if you could do the following:

julia> using ForwardDiff: derivative!

julia> using DiffBase: DiffResult

julia> derivative!(DiffResult(0., 0., 0.), sin, 1.0)
DiffBase.DiffResult{2,Float64,Tuple{Float64,Float64}}(0.8414709848078965,(0.5403023058681398,-0.8414709848078965))

Currently, derivative! will just calculate the first derivative:

julia> derivative!(DiffResult(0., 0., 0.), sin, 1.0)
DiffBase.DiffResult{2,Float64,Tuple{Float64,Float64}}(0.8414709848078965,(0.5403023058681398,0.0))

cc @YingboMa

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions