2 ms·
I'm going to try this instead of Halton sequences in my current project. One detail of the implementation that may be worth improving: z[i] = (seed +
by tlb 8y ago
I'm going to try this instead of Halton sequences in my current project.
One detail of the implementation that may be worth improving:
z[i] = (seed + alpha*(i+1)) %1
When i gets large, say 2^30, you're losing 30 bits of precision in the %1, so (with IEEE doubles) it can only take one of 2^23 values.
The usual implementation of Halton sequences get slower with large values of i, but doesn't suffer from quantization.
- extremelearning 8y agoThanks tlb. You're totally right. I wrote the example code to match the notation used in the post which is a reflection of my maths background. I suspect that from a programming perspective using the recurrence relation: z[i+1] = (z[i] + alpha) %1 is better practice in terms of both speed and accuracy. I have updated my post to make this clearer. Thanks.