🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.c
Article #308745

Re: test randomizacyjny w C

#308745
From: bartekltg
Date: Wed, 28 Sep 2016 11:09
34 lines
2951 bytes
On 27.09.2016 23:00, M.M. wrote:
> On Tuesday, September 27, 2016 at 10:40:12 PM UTC+2, Borneq wrote:
>> W dniu 27.09.2016 o 22:30, M.M. pisze:
>>> A tutaj testy z MT, wszystkie przeszedł. Test działał około 2 razy
>>> szybciej niż mojego generatora, ale MT nie korzystał z stdout, jest
>>> wkompilowany w diehardera.
>>
>> A możesz upublicznić kod swojego generatora?
>
> Nie ma co upubliczniać :)
>
> Ta ostatnia wersja to 5 generatorów fibonacciego. Jeden
> generator wybiera jeden z czterech.
>
> switch( rand1() % 4 ) {

To nie jest _tu_ bardzo istotne, ale taki sposób potrafi bardzo
popsuć losowość rand1. Ostatnie bity najczęśćeij są znacznie
mniej losowe. Doradzałbym podzielić (pewnie po prostu przesunąć
bitowo) najpierw do zakresu [0,3.999...].

>   case 0: return rand2();
>   case 1: return rand3();
>   case 2: return rand4();
>   case 3: return rand5();
> }

> Wszystkie rand1 do rand5 to generatory fibonaciego. Parametry dobrałem
> eksperymentalnie.

Obok zadałem pytanie dokąłdnie o to, nie musisz już na nie odpowiadać:)

pzdr
bartekltg
Technical Details
Message-ID: <nsg8cq$ftn$1@node2.news.atman.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail
References: <5777f44e$0$12548$65785112@news.neostrada.pl> <1121cd99-4f0c-42c9-af4e-bbb95846b221@googlegroups.com> <nsbi91$118$1@node2.news.atman.pl> <nsbja8$k91$1@node1.news.atman.pl> <nsbr2o$a64$1@node2.news.atman.pl> <nsbtc8$ch5$1@node2.news.atman.pl> <nsc0nj$fs7$1@node2.news.atman.pl> <nsc240$4fb$1@node1.news.atman.pl> <e4777e03-0727-4ca9-9beb-0d74176bc08b@googlegroups.com> <nsc44o$j5i$1@node2.news.atman.pl> <nsc4ik$jlr$1@node2.news.atman.pl> <nsdtnq$9cb$1@node2.news.atman.pl> <33d8cc17-5fae-445b-b34d-d9f0c0b00f32@googlegroups.com> <nsebkj$dt6$1@node1.news.atman.pl> <b92f5c87-2cf7-46a5-8046-ca65e9dcca9d@googlegroups.com> <nsedbk$fot$1@node1.news.atman.pl> <990f8ec5-a932-4b78-9e24-47a87018acb1@googlegroups.com> <nsehu3$so7$1@node2.news.atman.pl> <c1782be6-6830-4161-9b75-9c94b5c59019@googlegroups.com> <nsekjo$vfq$1@node2.news.atman.pl> <f5a11016-2b93-4ae4-99a8-f061568e58ad@googlegroups.com> <nselfa$or$1@node2.news.atman.pl> <a4377ce5-10a1-428c-bb1e-14cb114a6a70@googlegroups.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail
From: bartekltg <bartekltg@gmail.com>
Newsgroups: pl.comp.lang.c
Subject: Re: test randomizacyjny w C
Date: Wed, 28 Sep 2016 13:09:14 +0200
Organization: ATMAN - ATM S.A.
Lines: 36
Message-ID: <nsg8cq$ftn$1@node2.news.atman.pl>
References: <5777f44e$0$12548$65785112@news.neostrada.pl> <1121cd99-4f0c-42c9-af4e-bbb95846b221@googlegroups.com> <nsbi91$118$1@node2.news.atman.pl> <nsbja8$k91$1@node1.news.atman.pl> <nsbr2o$a64$1@node2.news.atman.pl> <nsbtc8$ch5$1@node2.news.atman.pl> <nsc0nj$fs7$1@node2.news.atman.pl> <nsc240$4fb$1@node1.news.atman.pl> <e4777e03-0727-4ca9-9beb-0d74176bc08b@googlegroups.com> <nsc44o$j5i$1@node2.news.atman.pl> <nsc4ik$jlr$1@node2.news.atman.pl> <nsdtnq$9cb$1@node2.news.atman.pl> <33d8cc17-5fae-445b-b34d-d9f0c0b00f32@googlegroups.com> <nsebkj$dt6$1@node1.news.atman.pl> <b92f5c87-2cf7-46a5-8046-ca65e9dcca9d@googlegroups.com> <nsedbk$fot$1@node1.news.atman.pl> <990f8ec5-a932-4b78-9e24-47a87018acb1@googlegroups.com> <nsehu3$so7$1@node2.news.atman.pl> <c1782be6-6830-4161-9b75-9c94b5c59019@googlegroups.com> <nsekjo$vfq$1@node2.news.atman.pl> <f5a11016-2b93-4ae4-99a8-f061568e58ad@googlegroups.com> <nselfa$or$1@node2.news.atman.pl> <a4377ce5-10a1-428c-bb1e-14cb114a6a70@googlegroups.com>
NNTP-Posting-Host: 89-70-119-159.dynamic.chello.pl
Mime-Version: 1.0
X-Trace: node2.news.atman.pl 1475060954 16311 89.70.119.159 (28 Sep 2016 11:09:14 GMT)
X-Complaints-To: usenet@atman.pl
NNTP-Posting-Date: Wed, 28 Sep 2016 11:09:14 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0
In-Reply-To: <a4377ce5-10a1-428c-bb1e-14cb114a6a70@googlegroups.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit