JuliaDiff / JuliaDiff/ForwardDiff.jl

Special case `x^1`

Open
#412 1 comment 2 reactions 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

x^0 is special-cased here (see https://github.com/JuliaDiff/ForwardDiff.jl/issues/331)

Could x^1 also be special-cased a couple of lines later?
Currently it instead calculates 1 * x^0. When x == 0 that relies on 0^0 being defined correctly.

(This led to the error in https://github.com/JuliaDiff/ForwardDiff.jl/issues/411.)

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 in src/dual.jl at the linked x^0 special case and inspect the couple of lines that handle x^1. Confirm the current path can evaluate 1 * x^0 when x is zero, then verify that the x^1 behavior no longer depends on the 0^0 case and addresses the error described in issue #411.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
devtools
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.