Search found 1208 matches

by dafhi
Nov 06, 2018 14:38
Forum: General
Topic: FreeBASIC's PRNG #2
Replies: 266
Views: 5156

Re: FreeBASIC's PRNG #2

the range thing. with a 64 bit state i guess the bias is ike a needle in a haystack. for a speedy range, you've found a highly unexpected (since mod relates with division) optimization [update] haven't debugged yet with yours (have 2 tests running) Dim Shared As Ulongint x = 12, w = 0 Dim As String ...
by dafhi
Nov 06, 2018 7:44
Forum: General
Topic: FreeBASIC's PRNG #2
Replies: 266
Views: 5156

Re: FreeBASIC's PRNG #2

finally got practRand working. Did a Windows restore and installed vc redist 2013. my new generator works well.
by dafhi
Nov 05, 2018 0:42
Forum: General
Topic: Bernard Widynski's Middle Square Weyl Sequence RNG (MsWs)
Replies: 106
Views: 1558

Re: Bernard Widynski's Middle Square Weyl Sequence RNG (MsWs)

I put hi first in a lot of range-based what-have-you's b/c more often than not, lo is 0

your test code, i gather from brief glances at various threads, is a good short-term indicator of randomness.

these silly RNGs keep distracting me from my new ray tracer :-)
by dafhi
Nov 04, 2018 2:38
Forum: General
Topic: Bernard Widynski's Middle Square Weyl Sequence RNG (MsWs)
Replies: 106
Views: 1558

Re: Bernard Widynski's Middle Square Weyl Sequence RNG (MsWs)

i'm testing the mod method on a ubyte LCG. just need "a few hours" debugging my test. i kind of already know the result but .. gotta code it ... Boom. function LCG as ubyte: const mul = 23, add = 3 static as ushort state: state = mul * state + add return state shr 8 End Function function r...
by dafhi
Nov 03, 2018 9:56
Forum: General
Topic: Bernard Widynski's Middle Square Weyl Sequence RNG (MsWs)
Replies: 106
Views: 1558

Re: Bernard Widynski's Middle Square Weyl Sequence RNG (MsWs)

also, you could get rid of the hi (+ 1) if you change params to double

deltarho[1859] wrote:Perhaps we need to write our own Mod function if it is fast enough.

:-)

i'm having a blast with this RNG stuff
by dafhi
Nov 03, 2018 4:09
Forum: Community Discussion
Topic: my best effort
Replies: 115
Views: 2966

Re: my best effort

theory vs. practice. are they frozen or are they moving? (dont say yes :P)
by dafhi
Nov 03, 2018 2:08
Forum: General
Topic: Bernard Widynski's Middle Square Weyl Sequence RNG (MsWs)
Replies: 106
Views: 1558

Re: Bernard Widynski's Middle Square Weyl Sequence RNG (MsWs)

range using modulus may fit unevenly into 2^64. the remainder goes to the least significant digits
by dafhi
Nov 03, 2018 2:06
Forum: Community Discussion
Topic: my best effort
Replies: 115
Views: 2966

Re: my best effort

imo you should just show them something.

acorns
by dafhi
Nov 02, 2018 3:33
Forum: General
Topic: timing benchmark using reduced precision
Replies: 4
Views: 124

Re: timing benchmark using reduced precision

always looking for ways to speed up my non-critical applications :-)
by dafhi
Nov 02, 2018 2:33
Forum: Tips and Tricks
Topic: my next RNG .. CSG 3
Replies: 0
Views: 81

my next RNG .. CSG 3

' Complex Sequence Generator 3 by dafhi - 2018 Nov 13 ' high period, high configurability PRNG ' breezes PractRand to 32TB w/ good constants (investigating) type CSG3_LITERAL as ubyte 'ulongint dim shared as CSG3_LITERAL csg3_mul = 255 ' non-ideal (32TB: 1645) dim shared as CSG3_LITERAL csg3_add = ...
by dafhi
Oct 30, 2018 2:23
Forum: General
Topic: Bernard Widynski's Middle Square Weyl Sequence RNG (MsWs)
Replies: 106
Views: 1558

Re: Bernard Widynski's Middle Square Weyl Sequence RNG (MsWs)

Int() is notoriously slow. even gcc -O 3 doesn't optimize it out

use this instead

Code: Select all

dim as integer result = rnd*(hi+1 - lo) - .5 + lo
by dafhi
Oct 27, 2018 19:26
Forum: Tips and Tricks
Topic: Simple Smoke Simulation build 2018-11-02
Replies: 10
Views: 281

Re: Simple Smoke Simulation build 2018-10-26

those clouds.

[update] totally forgot. happy birthday :-)
by dafhi
Oct 27, 2018 7:09
Forum: Tips and Tricks
Topic: RPG level stats
Replies: 0
Views: 72

RPG level stats

' ------------------------------------------------------------------- ' RPG level stats by dafhi ' ' release date: 2018 Oct 26 ' ' Based upon my journey through World of Warcraft ' coded sometime around 2015 ' ------------------------------------------------------------------- type stat_literal as ...
by dafhi
Oct 26, 2018 21:33
Forum: Tips and Tricks
Topic: Simple Smoke Simulation build 2018-11-02
Replies: 10
Views: 281

Re: Simple Smoke Simulation build 2018-10-26

one cannot deny the benefit of knowing asm. thanks for sharing
by dafhi
Oct 26, 2018 0:30
Forum: General
Topic: Squares
Replies: 6008
Views: 340248

Re: Squares

working on my newest random number generator, i thought i'd try a multiplier of 4, which produces a cool reflection pattern function CSG_ii as double '' 2018 Sep 17 '' produces a cool pattern const as ulongint mul = 4 static as ulongint a, state = 0 a += 1 - (state = 0) state = state shl 57 or state...

Go to advanced search