Article View: pl.comp.programming
Article #217312Re: Co robi permuted congruential generator XSL-RR-RR? Próbuję zrozumieć scheamt działania.
From: osobli...
Date: Sat, 02 Jan 2021 16:50
Date: Sat, 02 Jan 2021 16:50
18 lines
2376 bytes
2376 bytes
Znalazłem coś takiego na stronie autora:
https://www.pcg-random.org/download.html#c-implementation
#if PCG_HAS_128BIT_OPS
inline pcg128_t pcg_output_xsl_rr_rr_128_128(pcg128_t state)
{
uint32_t rot1 = (uint32_t)(state >> 122u);
uint64_t high = (uint64_t)(state >> 64u);
uint64_t low = (uint64_t)state;
uint64_t xored = high ^ low;
uint64_t newlow = pcg_rotr_64(xored, rot1);
uint64_t newhigh = pcg_rotr_64(high, newlow & 63u);
return (((pcg128_t)newhigh) << 64u) | newlow;
}
#endif
Wygląda na to, że chodzi o dwa razy o rotr64 i faktycznie na wikipedii jest błąd lub niedopatrzenie.
Technical Details
Message-ID:
<05e470d8-ea32-4cf2-b07d-79bb8d2dd267n@googlegroups.com>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!news.samoylyk.net!news.uzoreto.com!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mailReferences:
<2149118b-1cf9-4f45-b6a3-7b59a60446c4n@googlegroups.com> <20210102144507.535f1472@mateusz> <04697c4a-729b-4051-a3a0-346ded2aecd7n@googlegroups.com> <fbd46930-f562-4199-9336-cc021c363e4en@googlegroups.com> <20210102154922.59e6c404@mateusz> <41a2bd58-3ee9-4872-a80f-3aacb1e7d2c7n@googlegroups.com> <20210102171507.40aeb31a@mateusz>Show Full Headers
Complete Article Headers
X-Received: by 2002:a05:6214:321:: with SMTP id j1mr70332752qvu.32.1609606234492; Sat, 02 Jan 2021 08:50:34 -0800 (PST) X-Received: by 2002:a0c:b38b:: with SMTP id t11mr43769565qve.58.1609606234253; Sat, 02 Jan 2021 08:50:34 -0800 (PST) Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!news.samoylyk.net!news.uzoreto.com!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: pl.comp.programming Date: Sat, 2 Jan 2021 08:50:34 -0800 (PST) In-Reply-To: <20210102171507.40aeb31a@mateusz> Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=2a02:a458:2a00:1:7cc7:2090:a191:1806; posting-account=5sNFBgoAAAAxlae8lv99mPyGsDs6ynwB NNTP-Posting-Host: 2a02:a458:2a00:1:7cc7:2090:a191:1806 References: <2149118b-1cf9-4f45-b6a3-7b59a60446c4n@googlegroups.com> <20210102144507.535f1472@mateusz> <04697c4a-729b-4051-a3a0-346ded2aecd7n@googlegroups.com> <fbd46930-f562-4199-9336-cc021c363e4en@googlegroups.com> <20210102154922.59e6c404@mateusz> <41a2bd58-3ee9-4872-a80f-3aacb1e7d2c7n@googlegroups.com> <20210102171507.40aeb31a@mateusz> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <05e470d8-ea32-4cf2-b07d-79bb8d2dd267n@googlegroups.com> Subject: Re: Co robi permuted congruential generator XSL-RR-RR? Próbuję zrozumieć scheamt działania. From: "osobli...@gmail.com" <osobliwy.nick@gmail.com> Injection-Date: Sat, 02 Jan 2021 16:50:34 +0000 Lines: 18 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit