flat assembler
Message board for the users of flat assembler.
Index
> Tutorials and Examples > pmrand |
Author |
|
revolution 21 Feb 2023, 03:58
A input value of -2 in [s] will generate zero. And the same for the (-2) shr 1 (= 0x7fffffff).
What do you mean by "better statistics"? Which statistics are you referring to? |
|||
21 Feb 2023, 03:58 |
|
Ali.Z 21 Feb 2023, 05:10
input value of 0x7FFFFFFF should not generate 0, this is silly mistake by me; I will fix it. (but there is no difference, even if I fix it, it would repeat 0x7FFFFFFF forever)
as for -2 generating 0, I really don't know; I will figure it out later. better number distribution statistics (weighting). note: it returns a value in open interval (0,M) _________________ Asm For Wise Humans Last edited by Ali.Z on 21 Feb 2023, 05:23; edited 2 times in total |
|||
21 Feb 2023, 05:10 |
|
bitRAKE 21 Feb 2023, 05:13
So, [s] range would be [1,0x7FFFFFFE], making 0x7FFFFFFF an invalid input?
|
|||
21 Feb 2023, 05:13 |
|
Ali.Z 21 Feb 2023, 05:18
yes.
Ali.Z wrote: I will fix it. (but there is no difference, even if I fix it, it would repeat 0x7FFFFFFF forever) actually getting zero is good (if initial state is equ M), but if anyone don't want to get zero, then replace jns with jg. (in real world, it would never generate 0, the only way to get zero is by having initial state equ to M) and fixed -2 issue. _________________ Asm For Wise Humans |
|||
21 Feb 2023, 05:18 |
|
bitRAKE 21 Feb 2023, 15:37
The original Park-Miller article from 1988 can be found here:
http://www.cems.uwe.ac.uk/~irjohnso/coursenotes/ufeen8-15-m/p1192-parkmiller.pdf ... it says the A value was originally suggested in 1969. |
|||
21 Feb 2023, 15:37 |
|
Ali.Z 21 Feb 2023, 16:46
look here
https://www.firstpr.com.au/dsp/rand31/ exactly here for an update https://www.firstpr.com.au/dsp/rand31/p105-crawford.pdf _________________ Asm For Wise Humans |
|||
21 Feb 2023, 16:46 |
|
bitRAKE 21 Feb 2023, 17:45
Nice, that links to the 1969 paper - which outlines the original testing method.
(Lehmer actually suggests 14^29 for the A, in 1954.) _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
21 Feb 2023, 17:45 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.