You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The rounding of irrationals in Base Julia is not fully rigorous and can give incorrect results in extreme cases. This has as a consequence that intervals constructed from irrationals are not guaranteed to enclose them. For example, defining the irrational $1 - \pi^{-300}$ gives us
where the interval clearly doesn't contain the irrational.
For Base Julia these types of extreme cases are maybe fine to not get fully correct. For interval arithmetic not so much. I would propose to limit the construction of intervals from irrationals to only those irrationals which are implemented in mpfr, which are Irrational{:π}, Irrational{:γ} and Irrational{:catalan}. One could also support Irrational{:ℯ}, but one has to call mpfr directly since the regular constructor doesn't expose the rounding parameter.
Note that the constructors in src/constructors.jl under the comment
# by-pass the absence of `BigFloat(..., ROUNDING_MODE)` (cf. base/irrationals.jl)# for some irrationals defined in MathConstants (cf. base/mathconstants.jl)
are not safe, as by the above the rounding to Float64 is not safe.
The text was updated successfully, but these errors were encountered:
See 52941 and my comment in #615.
The rounding of irrationals in Base Julia is not fully rigorous and can give incorrect results in extreme cases. This has as a consequence that intervals constructed from irrationals are not guaranteed to enclose them. For example, defining the irrational$1 - \pi^{-300}$ gives us
where the interval clearly doesn't contain the irrational.
For Base Julia these types of extreme cases are maybe fine to not get fully correct. For interval arithmetic not so much. I would propose to limit the construction of intervals from irrationals to only those irrationals which are implemented in
mpfr
, which areIrrational{:π}
,Irrational{:γ}
andIrrational{:catalan}
. One could also supportIrrational{:ℯ}
, but one has to callmpfr
directly since the regular constructor doesn't expose the rounding parameter.Note that the constructors in
src/constructors.jl
under the commentare not safe, as by the above the rounding to
Float64
is not safe.The text was updated successfully, but these errors were encountered: