TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Evolution of Random Number Generators

131 点作者 algui91大约 4 年前

4 条评论

midjji大约 4 年前
Recently noted that mt19937, mt19937_64 are much faster than the standard c++ random generator. They are also possibly better with regards to number distribution, but the performance difference is gigantic on clang. The standard 32 bit std::default_random_generator is almost 40x slower than the 64 bit mt19937_64 one across the board, from -o1 to -O3 march... etc.<p>As all of them are also faster than old school rand, its worth upgrading for the performance increase if nothing else.
评论 #27015006 未加载
评论 #27015051 未加载
jedimastert大约 4 年前
I&#x27;m reminded of Chris Wellon&#x27;s &quot;Prospecting for Hash Functions&quot;, where he randomly generates hash functions and then runs them through a couple of tests.<p><a href="https:&#x2F;&#x2F;nullprogram.com&#x2F;blog&#x2F;2018&#x2F;07&#x2F;31&#x2F;" rel="nofollow">https:&#x2F;&#x2F;nullprogram.com&#x2F;blog&#x2F;2018&#x2F;07&#x2F;31&#x2F;</a><p>Out of curiosity, is running the state through a hash a reasonable rand strategy?
an1sotropy大约 4 年前
The PCG author (Melissa O&#x27;Neill of Harvey Mudd) has an interesting story of how PCG and its paper came about <a href="https:&#x2F;&#x2F;www.pcg-random.org&#x2F;posts&#x2F;history-of-the-pcg-paper.html" rel="nofollow">https:&#x2F;&#x2F;www.pcg-random.org&#x2F;posts&#x2F;history-of-the-pcg-paper.ht...</a> Good to read in case you think that academic peer review is the only way to introduce new and useful methods to the world.
TekMol大约 4 年前
I am looking for a simple random number generator that fills a given amount of slots.<p>Say it is initialized with &quot;size=5&quot; then it might output:<p>3,5,2,1,4<p>Is there something like this?<p>It does not need much statistical resemblence to randomness. Just look kind of random to the eye. And the code should be short. A few lines of Javascript or so.<p>Maybe one approach might be to just loop through the sequence (1,2,3,4,5) and xor the number with some other number? Maybe with 0101010...?
评论 #27013748 未加载
评论 #27014674 未加载
评论 #27015014 未加载
评论 #27014558 未加载
评论 #27014015 未加载
评论 #27013479 未加载
评论 #27015966 未加载
评论 #27015171 未加载
评论 #27013745 未加载
评论 #27015903 未加载
评论 #27013540 未加载