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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Mersenne Twister PRNG for JavaScript

10 点作者 gmac12 个月前

4 条评论

stouset12 个月前
I’m always surprised to see the disproportionate levels of attention the Mersenne Twister seems to get.<p>It’s not a particularly noteworthy PRNG. It’s not all that fast. It’s not simpler to implement. It’s not suitable for cryptography.<p>About the only interesting property I’m aware of is the comically large period, but 2^19937 is no more useful than 2^64 for almost all non-cryptographic workloads and 2^256 is thermodynamically sufficient until we start exploiting the multiverse. Past that is just wasting memory and CPU cycles to no meaningful end. Plus, having a large period doesn’t necessarily indicate quality.<p>So what makes this particular PRNG so weirdly sticky? Is it just the cool name?
评论 #40480464 未加载
评论 #40480438 未加载
评论 #40480395 未加载
评论 #40486535 未加载
评论 #40480375 未加载
ReleaseCandidat12 个月前
This needs &quot;It is high time we let go of the Mersenne Twister&quot; <a href="https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;1910.06437" rel="nofollow">https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;1910.06437</a><p><pre><code> This paper surveys these results for the non-specialist, providing new, simple, understandable examples, and it is intended as a guide for the final user, or for language implementors, so that they can take an informed decision about whether to use the Mersenne Twister or not.</code></pre>
评论 #40480684 未加载
hyperman112 个月前
I&#x27;ve seen a Mersenne twister in the wild, implemented in Excel VBA. The small differences in numeric behaviour caused the author to re-implement basic numeric operations like additions.<p>It was used in a Mone Carlo simulation implemented on data in excel sheet. The thing was 4K lines of VBA and was extermely slow: It did its simulation over 8 hours for a few 100K iterations.<p>Someone had given it to a &#x27;High performance excel developer&#x27; company (!) and they ran into their limits. I reimplemented it in single threaded C in the evening, and it did its thing in seconds. But that was not acceptable, as the end user could not adapt the VBA anymore.<p>So I dumped only the Mersenne twister in a DLL, imported that in VBA, and it gained 10% speed, basically all time spent in the RNG. I suggested moving other parts to C, but they didn&#x27;t want to break ties with the excel programmers and nothing came from it.
lrvick12 个月前
Mersenne twister implementations have cost millions in theft, and will continue to.<p><a href="https:&#x2F;&#x2F;milksad.info" rel="nofollow">https:&#x2F;&#x2F;milksad.info</a>
评论 #40482237 未加载