-
Notifications
You must be signed in to change notification settings - Fork 26
Closed
Description
With the MWE
using StatsFuns, IntervalArithmetic, IntervalRootFinding
function interval_solver_internal(Cm::T, Dm::T, Cf::T, Df::T) where T
f(p) = normcdf(Cm + Dm * normcdf(Cf + Df * p)) - p
roots(f, interval(0.0, 1.0))
endI run into the stack trace
ERROR: ArgumentError: only irrationals from MathConstants are supported
Stacktrace:
[1] _round(::Type{Float64}, ::IrrationalConstants.Invsqrt2π, ::RoundingMode{:Down})
@ IntervalArithmetic ~/.julia/packages/IntervalArithmetic/0gLWz/src/intervals/construction.jl:90
[2] _unsafe_bareinterval(::Type{Float64}, a::IrrationalConstants.Invsqrt2π, b::IrrationalConstants.Invsqrt2π)
@ IntervalArithmetic ~/.julia/packages/IntervalArithmetic/0gLWz/src/intervals/construction.jl:77
[3] _interval_infsup(::Type{…}, a::IrrationalConstants.Invsqrt2π, b::IrrationalConstants.Invsqrt2π, d::IntervalArithmetic.Decoration)
@ IntervalArithmetic ~/.julia/packages/IntervalArithmetic/0gLWz/src/intervals/construction.jl:420
[4] #interval#3
@ ~/.julia/packages/IntervalArithmetic/0gLWz/src/intervals/construction.jl:389 [inlined]
[5] interval(::Type{Float64}, a::IrrationalConstants.Invsqrt2π, d::IntervalArithmetic.Decoration)
@ IntervalArithmetic ~/.julia/packages/IntervalArithmetic/0gLWz/src/intervals/construction.jl:388
[6] interval(::Type{Float64}, a::IrrationalConstants.Invsqrt2π)
@ IntervalArithmetic ~/.julia/packages/IntervalArithmetic/0gLWz/src/intervals/construction.jl:388
[7] convert(::Type{Interval{Float64}}, x::IrrationalConstants.Invsqrt2π)
@ IntervalArithmetic ~/.julia/packages/IntervalArithmetic/0gLWz/src/intervals/construction.jl:558
[8] _promote
@ ./promotion.jl:375 [inlined]
[9] promote
@ ./promotion.jl:400 [inlined]
[10] *(x::Interval{Float64}, y::IrrationalConstants.Invsqrt2π)
@ Base ./promotion.jl:430
[11] normpdf(z::Interval{Float64})
@ StatsFuns ~/.julia/packages/StatsFuns/gSNRw/src/distrs/norm.jl:13I understand the logic of the error message, but I am wondering what would be the best way to go forward here. Add a _round method for these types, maybe loaded conditionally?
Metadata
Metadata
Assignees
Labels
No labels