JuliaIntervals / IntervalContractors.jl

Interval contractors and inverse (reverse) functions for Julia
Other
10 stars 10 forks source link

Fails with version 0.16.3 of IntervalArithmetic #39

Closed mewilhel closed 4 years ago

mewilhel commented 4 years ago

The pi_interval is no longer exported in IntervalArithmetic 0.16.3. So in trig.jl line 59 and 128, IntervalArithmetic.pi_interval(Float64) needs to be swapped for Interval{Float64}(π) or an upper bound of 0.16.2 needs to be added to the project.toml.

function cos_main(X::IntervalBox)

    x, y = X

    x_range = Interval(0, IntervalArithmetic.pi_interval(Float64).lo)
    y_range = -1..1

    x = x ∩ x_range
    y = y ∩ y_range

    isempty(IntervalBox(x, y)) && return IntervalBox(x, y)

    y = y ∩ cos(x)
    x = x ∩ acos(y)

    return IntervalBox(x, y)

end
tan!(X::IntervalBox) = periodise(tan_main, IntervalArithmetic.pi_interval(Float64))(X)
dpsanders commented 4 years ago

Sorry I only just saw this for some reason. Thanks for the report. Would you mind making a PR for this?

mewilhel commented 4 years ago

Gladly! #42