Skip to content

Hessian is wrong with intervals #411

Closed
@dpsanders

Description

@dpsanders
julia> using IntervalArithmetic, ForwardDiff, StaticArrays

julia> f(X) = ( (x, y) = X; x^2 + y^2 )
f (generic function with 2 methods)

julia> ForwardDiff.hessian(f, SVector(0..0, 0..0))
2×2 SArray{Tuple{2,2},Interval{Float64},2,4} with indices SOneTo(2)×SOneTo(2):
 [0, 2]  [0, 0]
 [0, 0]  [0, 2]

(Note that these are intervals being printed, not arrays.)
The diagonal entries are incorrect: they should be 2..2.

Cf. the same problem in
JuliaDiff/SparseDiffTools.jl#67

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