Re:State of the art of random double generation
by SamReidHughes on Friday April 10, 2015 @02:59PM
(#9356417)
> Only when you throw the dart, repeat until you are in the target interval, and then look for the nearest representable number.
Yeah, when you throw your dart at the target interval.
> If you throw the dart, look for the nearest representable number and repeat until that number is in the interval, you get something different.
I don't know why you'd want to throw a uniform dart at some other, larger interval, before culling it down. You can't throw a uniform random dart at the entire real line. I think what you're describing gives undue representation to the edges -- you wouldn't use those sampling points with those weightings to integrate a function, but you might use the trapezoid method.
> The hypothetical uniform dart is as likely to land between 1 and 2 as it is to land between 2 and 3, but there are more representable numbers in the first range than in the second.
Yeah, when you throw your dart at the target interval.
> If you throw the dart, look for the nearest representable number and repeat until that number is in the interval, you get something different.
I don't know why you'd want to throw a uniform dart at some other, larger interval, before culling it down. You can't throw a uniform random dart at the entire real line. I think what you're describing gives undue representation to the edges -- you wouldn't use those sampling points with those weightings to integrate a function, but you might use the trapezoid method.
> The hypothetical uniform dart is as likely to land between 1 and 2 as it is to land between 2 and 3, but there are more representable numbers in the first range than in the second.
That's a fact of life.