erf() and IntervalRootFinding

Viewed 45

I realize this is a pretty niche problem, but I figure it's worth asking anyway.

I'm working on a program that does root-finding, and the function that it's trying to find a root for involves computing Fresnel integrals, which are implemented using erf(). I thought I'd try using the IntervalRootFinding package, but haven't gotten very far with it. I get a MethodError exception, which looks like:

MethodError: no method matching _erf(::Complex{IntervalArithmetic.Interval{Float64}})

Any advice?

1 Answers

IntervalArithmatic requires that your functions know how to work with intervals. Since erf is monotonic, you could define your own implimentation

using IntervalArithmatic
erf(x::Interval{T}) where T = Interval(prevfloat(erf(x.lo)), nextfloat(erf(x.hi)))
Related