Skip to content

More beautiful display of :unknown #247

Merged
Kolaru merged 3 commits into
JuliaIntervals:masterfrom
Kolaru:reasonnable_display
Jun 24, 2026
Merged

More beautiful display of :unknown #247
Kolaru merged 3 commits into
JuliaIntervals:masterfrom
Kolaru:reasonnable_display

Conversation

@Kolaru

@Kolaru Kolaru commented May 15, 2026

Copy link
Copy Markdown
Member

As discussed in the JuliaInterval call, this PR reintroduces showing more information for :unknown roots in vectors, with fancy connector to group the information.

However, this information is still hidden if the IOContext is :compact, like for matrices:

julia> f(x) = (x < 1) ? x : (x - 2)^2 * (x - 3)
f (generic function with 1 method)

julia> rts = roots(f, interval(-5, 5))
4-element Vector{Root{Interval{Float64}}}:
 Root([0.0, 0.0]_com, :unique)
 Root([1.0, 1.0]_com, :unknown)
 ├ Not converged: region size smaller than the tolerance
 ├ Warning: error encountered during computation (use showerror(root.error) to see the whole stacktrace)
 └ InconclusiveBooleanOperation: The operation `[1.0, 1.0]_com < [1.0, 1.0]_com_NG` cannot be determined unambiguously. See the documentation for more information. See also `strictprecedes`.
 Root([2.0, 2.0]_com_NG, :unknown)
 └ Not converged: region size smaller than the tolerance
 Root([3.0, 3.0]_com_NG, :unique)

julia> reshape(rts, 2, 2)
2×2 Matrix{Root{Interval{Float64}}}:
 Root([0.0, 0.0]_com, :unique)   Root([2.0, 2.0]_com_NG, :unknown)
 Root([1.0, 1.0]_com, :unknown)  Root([3.0, 3.0]_com_NG, :unique)

@dpsanders @OlivierHnt

@github-actions

github-actions Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

Benchmark Results

master 0bcfd9b... master / 0bcfd9b...
10 dimensional/IntervalRootFinding.Krawczyk 3.13 ± 0.041 s 3.13 ± 0.045 s 0.998 ± 0.019
10 dimensional/IntervalRootFinding.Newton 48 s 48.2 s 0.994
Dietmar-Ratz/Dietmar-Ratz 1/IntervalRootFinding.Krawczyk 3.58 ± 0.09 μs 3.63 ± 0.09 μs 0.986 ± 0.035
Dietmar-Ratz/Dietmar-Ratz 1/IntervalRootFinding.Newton 3.57 ± 0.08 μs 3.61 ± 0.091 μs 0.989 ± 0.033
Dietmar-Ratz/Dietmar-Ratz 2/IntervalRootFinding.Krawczyk 0.102 ± 0.0013 ms 0.102 ± 0.0011 ms 0.998 ± 0.017
Dietmar-Ratz/Dietmar-Ratz 2/IntervalRootFinding.Newton 0.238 ± 0.012 ms 0.239 ± 0.011 ms 0.996 ± 0.069
Dietmar-Ratz/Dietmar-Ratz 3/IntervalRootFinding.Krawczyk 0.252 ± 0.014 ms 0.252 ± 0.013 ms 1 ± 0.075
Dietmar-Ratz/Dietmar-Ratz 3/IntervalRootFinding.Newton 0.177 ± 0.012 ms 0.179 ± 0.011 ms 0.99 ± 0.09
Dietmar-Ratz/Dietmar-Ratz 4/IntervalRootFinding.Krawczyk 0.0518 ± 0.00076 ms 0.0506 ± 0.00061 ms 1.02 ± 0.019
Dietmar-Ratz/Dietmar-Ratz 4/IntervalRootFinding.Newton 0.0345 ± 0.0017 ms 0.0336 ± 0.001 ms 1.03 ± 0.059
Dietmar-Ratz/Dietmar-Ratz 5/IntervalRootFinding.Krawczyk 3.46 ± 0.11 μs 3.46 ± 0.12 μs 1 ± 0.047
Dietmar-Ratz/Dietmar-Ratz 5/IntervalRootFinding.Newton 3.47 ± 0.12 μs 3.43 ± 0.12 μs 1.01 ± 0.05
Dietmar-Ratz/Dietmar-Ratz 6/IntervalRootFinding.Krawczyk 13.2 ± 0.2 μs 13.1 ± 0.24 μs 1.01 ± 0.024
Dietmar-Ratz/Dietmar-Ratz 6/IntervalRootFinding.Newton 19.7 ± 0.34 μs 19.8 ± 0.39 μs 0.996 ± 0.026
Dietmar-Ratz/Dietmar-Ratz 7/IntervalRootFinding.Krawczyk 3.67 ± 0.099 μs 3.64 ± 0.08 μs 1.01 ± 0.035
Dietmar-Ratz/Dietmar-Ratz 7/IntervalRootFinding.Newton 3.67 ± 0.099 μs 3.64 ± 0.1 μs 1.01 ± 0.039
Dietmar-Ratz/Dietmar-Ratz 9/IntervalRootFinding.Krawczyk 3.98 ± 0.09 μs 3.96 ± 0.09 μs 1 ± 0.032
Dietmar-Ratz/Dietmar-Ratz 9/IntervalRootFinding.Newton 3.96 ± 0.1 μs 3.98 ± 0.091 μs 0.995 ± 0.034
Rastigrin stationary points/IntervalRootFinding.Krawczyk 0.147 ± 0.002 s 0.146 ± 0.0016 s 1 ± 0.018
Rastigrin stationary points/IntervalRootFinding.Newton 0.139 ± 0.0014 s 0.138 ± 0.00094 s 1 ± 0.012
Smiley/Smiley and Chun (2001), Example 2.2/IntervalRootFinding.Krawczyk 2.7 ± 0.051 ms 2.68 ± 0.053 ms 1.01 ± 0.027
Smiley/Smiley and Chun (2001), Example 2.2/IntervalRootFinding.Newton 2.16 ± 0.041 ms 2.1 ± 0.038 ms 1.03 ± 0.027
Smiley/Smiley and Chun (2001), Example 5.2/IntervalRootFinding.Krawczyk 0.037 ± 0.0034 s 0.0361 ± 0.0033 s 1.02 ± 0.13
Smiley/Smiley and Chun (2001), Example 5.2/IntervalRootFinding.Newton 0.0317 ± 0.0032 s 31.1 ± 3.2 ms 1.02 ± 0.15
Smiley/Smiley and Chun (2001), Example 5.4/IntervalRootFinding.Krawczyk 1.9 ± 0.032 ms 1.88 ± 0.03 ms 1.01 ± 0.023
Smiley/Smiley and Chun (2001), Example 5.4/IntervalRootFinding.Newton 1.8 ± 0.026 ms 1.76 ± 0.029 ms 1.02 ± 0.023
Smiley/Smiley and Chun (2001), Example 5.5/IntervalRootFinding.Krawczyk 5.5 s 5.48 s 1
Smiley/Smiley and Chun (2001), Example 5.5/IntervalRootFinding.Newton 5.04 s 5.01 s 1.01
time_to_load 0.397 ± 0.0064 s 0.401 ± 0.011 s 0.99 ± 0.031

Benchmark Plots

A plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR.
Go to "Actions"->"Benchmark a pull request"->[the most recent run]->"Artifacts" (at the bottom).

@OlivierHnt

Copy link
Copy Markdown
Member

Really nice! There are only a few doctests to fix.

@Kolaru Kolaru force-pushed the reasonnable_display branch from 48f0a82 to c06f8e4 Compare June 24, 2026 15:34
@Kolaru

Kolaru commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

As discussed during the JuliaInterval call, this can be shipped :)

@Kolaru Kolaru merged commit d0453d8 into JuliaIntervals:master Jun 24, 2026
8 checks passed
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

Successfully merging this pull request may close these issues.

2 participants