<isabella>
(pi isn't very precise to fit within the timeout on godbolt)
_whitelogger has joined ##bash-crimes
<sdomi>
isabella: holy crap
<sdomi>
this is cool
<sdomi>
finally, it has been determined that meow=1.202056
<sdomi>
scientific breakthrough
<sdomi>
tried figuring out the general logic, but not all of this easily unwraps in my head. i'd love to read a full explanation if you're bored :)
<isabella>
Yeah so it's computing pi, and the last few numbers from the rng are left basically untouched in the array
<isabella>
A[0] is pi computed with the Monte Carlo method
<isabella>
The lcong48/drand48 api is an LCG
<isabella>
If you look at the implementations in musl, they're really straightforward and drand48 basically returns the whole 48 bits of state basically untouched, just converted to a double
<isabella>
So I tried to look for exact solutions to force it to produce a number of interesting constants, but there are no exact ones. However I really only needed 6 digits of precision. For each value this gives you a range of 48 bit numbers that produce it
<isabella>
If you e.g. fix a value for e and a value for phi, and a value for the c parameter in lcong48, this completely identifies the sequence and you can compute the a parameter
<isabella>
Basically I fixed those and brute forced the other 2
<sdomi>
really cool
<isabella>
Ty 😊 I kinda want to go further now and write the brute force search for GPU but I don't know anything about GPU programming
<isabella>
I did the search on my laptop that kept overheating and reducing the CPU frequency 😑
<isabella>
Is that paper reference a dumb idea? It's a real paper but obviously those values are not from there
<isabella>
Obfuscation by reference that the reader won't be arsed to look up
<sdomi>
i initially thought they were, but didn't have a chance to look for the paper itself