Skip to content

searchsortedfirst of dual returning wrong result #742

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
oscardssmith opened this issue Apr 7, 2025 · 4 comments
Closed

searchsortedfirst of dual returning wrong result #742

oscardssmith opened this issue Apr 7, 2025 · 4 comments

Comments

@oscardssmith
Copy link
Member

This is presumably caused by [email protected] and is causing test failures in SciML/DataInterpolations.jl#414

julia> searchsortedfirst([0.0, 1.0, 2.0, 3.0], 1.0)
2

julia> searchsortedfirst([0.0, 1.0, 2.0, 3.0], ForwardDiff.Dual(1.0, (1.0,)))
3
@devmotion
Copy link
Member

This is both expected and (IMO) intended: a Dual with positive partial value is strictly greater than one with the same primal but zero partial value.

@devmotion
Copy link
Member

The change is caused by #695 which fixed the broken isless etc definitions for Duals.

@oscardssmith
Copy link
Member Author

Thanks for the quick response. I agree that DataInterpolations seems to be doing some fairly sketchy things here...

@ChrisRackauckas
Copy link
Member

The DataInterpolations derivative implementation needs to take this into account based on the continuity argument. We can take it to that repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants