JuliaDiff / JuliaDiff/ForwardDiff.jl

API for high-order scalar derivatives

Open
#187 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
1k
Forks
160
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the existing derivative! entry point and its DiffBase.DiffResult integration. Compare the requested sin example with the current first-derivative result, then verify that higher-order scalar derivatives are populated correctly in the returned DiffResult.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.