IntervalRootFinding tolerance

Hi guys,

I’m trying to use IntervalRootFinding to find the roots of a 2-D function (compute_implied_r in the example below), which outputs a 2-D vector.

roots(compute_implied_r, IntervalBox(0.9..10,0.9..10), Newton, 1e-1)

However, when I use the roots function, I get the following output:

Root{IntervalBox{2, Float64}}[]

I’m interpreting this as saying that there are no roots within my tolerance of 1e-1. However, this is a bit strange because when I just throw in a random input into my function, it outputs something that should be within that tolerance.

compute_implied_r((1.04, 1.31))
2-element SVector{2, Float64} with indices SOneTo(2):

I’d really appreciate any help understanding this/advice, thank you!

See the docs. The tolerance parameter, tol, is a diameter on your function’s domain.

Thanks, that explains it. It doesn’t seem like there’s a way to change the tolerance of the root, is there?

You’re trying to find points that have small but nonzero magnitude? If so, I think that IntervalRootFinding is the wrong tool for the job.


If you want to use IntervalRootFinding for that job, you should probably use roots(f .+ -0.1..0.1, ...). But this is likely to return large enclosures and become very slow, I am afraid.