Talk:ACORN (random number generator)

COI
Do any editors here have a wp:coi? Slatersteven (talk) 16:54, 6 April 2022 (UTC)


 * @Slatersteven@Blah2 yes! after reading numerous COI and POV pages it appears that I may have potential or apparent COI. But I am NOT the developer of ACORN, and I am NOT paid for any of my numerous contributions to Wikipedia, where I always do my best to have a neutral and critical point of view.
 * where should this discussion be continued - here or on my talk page or on the COI page as suggested by @A. C. Santacruz
 * how do you suggest that I should proceed ? (I suppose you and other mathematically-minded editors will want to judge notability and neutrality). jw (talk) 19:50, 6 April 2022 (UTC)
 * It might be best to make edit requests here, and wait others to make them. Slatersteven (talk) 09:18, 7 April 2022 (UTC)

Requested move 1 July 2023

 * The following is a closed discussion of a requested move. Please do not modify it. Subsequent comments should be made in a new section on the talk page. Editors desiring to contest the closing decision should consider a move review after discussing it on the closer's talk page. No further edits should be made to this discussion.

The result of the move request was: moved. (non-admin closure) &#123;&#123;replyto&#124; SilverLocust &#125;&#125; (talk) 01:27, 8 July 2023 (UTC)

ACORN (PRNG) → ACORN (random number generator) – Disambiguators should be intelligible to the common reader, not jargon. * Pppery * it has begun... 00:04, 1 July 2023 (UTC)
 * Support per nom. Skynxnex (talk) 04:20, 3 July 2023 (UTC)

The discussion above is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.

C++11 example code
Hello! I've wanted to to give this PRNG a try before, but the current example code is somewhat impenetrable. I ran it through chatgpt to get a C translation, which I then turned into a C++11 implementation. It looks like this (i have no idea how to format it on this page):

Does this seem fit for inclusion?

Notes:

Unlike the current example which generates 64 bits and turns it into a double precision float, this code simply generates 32 bits (should maybe be even less? see below).

Also, I'm pretty sure the float generation method used in the fortran example code (division by modulus) introduces bias and besides, it isn't strictly part of the PRNG so I left it out.

Something else that doesn't seem to be mentioned anywhere is that the lower bits are of poor quality. Returning the full 64-bit element quickly fails PractRand's tests. I wanted to make sure I didn't do anything wrong so I searched around and found these polish forum posts (used google translate to read):. This person realized the same thing: casting the generated bits to a double float will discard some of the lower bits and mask the problem, but it's not exactly spelled out very clearly.

Now, the C++ example code outputs 32 bits and will actually fail PractRand pretty early as well... to avoid this, 128 bit elements could be used or the output could be smaller (24 bits seem fine but isn't a convenient size, so the next step is 16 bits). I'm not a fan of either really, but if we would like the example to not fail PractRand early I'd maybe go with 16 bit output as 128 bit integers aren't super common (I think?).

Quick aside... I think everyone already knows, but the article was clearly written by someone with vested interest, haha. Fred Underscore (talk) 09:07, 5 July 2023 (UTC)


 * Hi @Fred Underscore, there are not any hard and fast rules on Wikipedia, yet, about LLM but you can see some of the gathering consensus about them at both WP:LLM and WP:ChatGPT. I, personally, am pretty against including ChatGPT or other automatically generated code examples on Wikipedia. If a read wants to see such things, they're free to generate it themselves using a current LLM. We should only include well-understood (by the editor who adds it) and known-correct code as much as possible. So if you want to find either an open source version with a compatible license or you feel like you could write your own that'd be an improvement, that'd be welcome. Skynxnex (talk) 20:05, 17 July 2023 (UTC)
 * Maybe I was being unclear! I asked chatGPT to translate the code to C as the current code example is very hard to read. With the help of the C translation I could figure out what the FORTRAN code is doing and I then wrote my own C++ implementation.
 * My reason for doing this whole thing in the first place is that the description of how ACORN works on its website is rather hard to follow (unless you're a comp sci person maybe), and the current code example is also hard to follow - FORTRAN is not very common in this day and age, and compact code with variable names such as "IXV1" and "KORDEJ" is hard to dissect. Fred Underscore (talk) 21:27, 17 July 2023 (UTC)
 * Ah yes, I think if you've written an implementation like that using ChatGPT output to help you understand the problem, that should be fine. This maybe would require me to just understand ACRON itself a bit more and is for my own edification, but why does the C++ code have an explicit array with preset values while the Fortran doesn't?
 * (As for formatting the code, you would probably want to wrap it in which would give:
 * (As for formatting the code, you would probably want to wrap it in which would give:


 * Hope that helps some.) Skynxnex (talk) 18:47, 18 July 2023 (UTC)
 * Your comment about submitting AI generated content is understandable! Maybe I shouldn't even have mentioned it since it didn't submit anything generated, I guess I just wanted to detail my process for some reason.
 * In any case, I already had an idea of what the number generator was supposed to do, I just wanted to go through the "official" code example to make sure I got it right.
 * "why does the C++ code have an explicit array with preset values while the Fortran doesn't?"
 * I just filled an array with some randomly generated values to use as an example. It definitely could be left blank instead, with the comment above it mentioning how to initialize it.
 * One could go even further and change the array to a vector (and maybe an accompanying init function that sets the length and some initial values), as the size of the array could be just about anything. Fred Underscore (talk) 18:39, 19 July 2023 (UTC)
 * One could go even further and change the array to a vector (and maybe an accompanying init function that sets the length and some initial values), as the size of the array could be just about anything. Fred Underscore (talk) 18:39, 19 July 2023 (UTC)