JuliaDiff / JuliaDiff/FiniteDifferences.jl

jvp incorrect result rather than erroring

Open
#90 10 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Julia
Stars
318
Forks
32
PR merge metrics
No merged PRs in 30d

Description

There appears to be a problem with jvp when the v supplied is real and the primal is complex:

using FiniteDifferences
jvp(central_fdm(5,1), abs2, (3.0 + im, 0.25))

#+RESULTS:
: 1.9999999999995874
jvp(central_fdm(5,1), abs2, (3.0 + im, 0.25 + 0im))

#+RESULTS:
: 1.4999999999999445

The correct, answer here is 1.5. This should produce an error.

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 by reproducing the two jvp(central_fdm(5,1), abs2, ...) calls from the issue, then locate the jvp implementation and its tests. Done means a real-valued direction with a complex primal errors, while the explicitly complex direction continues to return the correct value, 1.5.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.