Distributions.jl icon indicating copy to clipboard operation
Distributions.jl copied to clipboard

`0 <= cdf(truncated(Normal(2.5, 0.2), lower=0.0),x)` not always true.

Open lrnv opened this issue 4 months ago • 2 comments

Followup to #1853

Consider the following:

using Distributions
D = truncated(Normal(2.5, 0.2), lower=0.0)
cdf(D, 3.741058503233821e-17) > 0  # false
cdf(D, 1.4354474178676617e-18) > 0 # false
cdf(D, 8.834854780587132e-18) > 0  # false

I think I am simply hitting catastrophic cancellation in this line.

I understand that such numerical incauracies are always possible at borders, but would that be considered a bug ?

lrnv avatar Apr 20 '24 09:04 lrnv