Skip to content

Implementations of SFC32/SFC64 chaotic RNGs #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

tertu-m
Copy link

@tertu-m tertu-m commented Jun 20, 2025

This adds an implementation of the SFC32 and SFC64 chaotic RNGs.

There's some work left to be done regarding docs and formatting but they should work; I would like feedback on that.

EDIT: I'm also not even sure if this would be useful. One advantage it does have, perhaps, is that it does not require multiplication at all.

Copy link
Member

@dhardy dhardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At a glance, this seems like something we could add. But should we?

  • I'd like some justification of why this is useful to people.
  • Would you be willing to maintain this in case of future bug reports / requests?

@@ -0,0 +1,39 @@
// Copyright 2025 XXX.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfinished?

Copy link
Author

@tertu-m tertu-m Jun 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update that to mention the project now.

@tertu-m
Copy link
Author

tertu-m commented Jun 21, 2025

I would be willing to maintain this in the future.

My reasons for suggesting they are included that they are simple, fast generators (in my experience and based on what I could find on the internet they are slightly faster than Xoshiro and faster than PCG), they are high quality, they are reasonably well known as far as I am aware, and they are structurally different from the existing generators present in rand.

Additionally, in principle, stream support could be added as I mentioned in the comments, and this has been done by some people, but I don't think that functionality is very well studied. It is known that correlations exist early in two streams with different increments if the initial values provided for a, b, and c are the same.

EDIT: I guess you knew all that already; I read the comments later where that was mentioned. Anyway I guess it had been talked about in the past and the thought was maybe one more choice would be nice? This implementation doesn't have the counter panic issue, anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants