Deprecated: Creation of dynamic property NewFoldLabs\WP\Module\MyProducts\ProductsApi::$namespace is deprecated in /home3/enderthr/public_html/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php on line 41

Deprecated: Creation of dynamic property NewFoldLabs\WP\Module\MyProducts\ProductsApi::$rest_base is deprecated in /home3/enderthr/public_html/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php on line 42

Warning: Cannot modify header information - headers already sent by (output started at /home3/enderthr/public_html/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php:41) in /home3/enderthr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home3/enderthr/public_html/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php:41) in /home3/enderthr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home3/enderthr/public_html/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php:41) in /home3/enderthr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home3/enderthr/public_html/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php:41) in /home3/enderthr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home3/enderthr/public_html/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php:41) in /home3/enderthr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home3/enderthr/public_html/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php:41) in /home3/enderthr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home3/enderthr/public_html/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php:41) in /home3/enderthr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home3/enderthr/public_html/wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-my-products/includes/ProductsApi.php:41) in /home3/enderthr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831
{"id":121,"date":"2023-06-11T00:48:47","date_gmt":"2023-06-11T00:48:47","guid":{"rendered":"https:\/\/ender314.com\/?p=121"},"modified":"2023-06-14T17:51:59","modified_gmt":"2023-06-14T17:51:59","slug":"characterizing-the-rotate-multiply-iterated-function-part-i","status":"publish","type":"post","link":"https:\/\/ender314.com\/?p=121","title":{"rendered":"Characterizing the Rotate-Multiply Iterated Function Part I"},"content":{"rendered":"\n

I have been playing with genetic programming for several years, attempting to use it to create pseudo random number generators (RNGs) and hash functions. In the course of doing this, with various parameters, I frequently encountered the pseudorandom number generator given by combining a bitwise rotation and a multiply. Sample C# code below, with rotation constant b and multiplication constant c.<\/p>\n\n\n\n

public ulong Next()\n{\n\t_state = c * BitOperations.RotateLeft(_state, b);\n\treturn _state;\n}<\/code><\/pre>\n\n\n\n

This is a somewhat random function as is, but it has several shortcomings. First, it\u2019s not quite random enough by itself unless you only use half of the output. Second, the period is not well known. The period of an RNG is the number of values it returns before it starts repeating. For most commercial RNGs, the period is known mathematically, or at least a lower bound on it is known. For the RNG above, The period might be as short as 1 or as long as 2^64-1, which is the range of possible non-zero values of a ulong (Clearly the value zero is unchanged by the rotate-multiply, so this generator would have to be seeded with a non-zero value).<\/p>\n\n\n\n

Starting from some initial value of _state (an initial, or seed value), and repeatedly calling the function above, it will obviously eventually repeat. The set of values that it traverses before repeating is called the cycle, which has a length. The ideal case that we are searching for is a “full cycle”, where the function traverses every possible value before repeating. We will see that constants b and c which have full cycle are rare. Most have a number of cycles of varying length. Some have multiple cycles of length 1, and some sets of constants b and c have thousands of cycles all length 4 or less. Obviously that doesn’t make for a very good random generator if it keeps returning the same four values in a row, which is why we are trying to find those “full cycle” constants. <\/p>\n\n\n\n

Recall that bitwise rotation is a common low-level operation in computers, and is quite simple. For comparison, if we were discussing 5 digit decimal numbers, then RotateLeft(12345,2)=34512 and RotateLeft(100,3)=1. Bitwise rotation is the same thing in base 2 arithmetic. Since computers represent everything in base 2 with zeroes and ones, bitwise rotation is natural, and a well-known way of mixing portions of a number in many cryptographic hash functions or ciphers.<\/p>\n\n\n\n

Also, recall that computers use modular arithmetic for integers. That sounds fancier than it is, it really means that the result of any operation is considered as the remainder with the modulus. For instance, among the integers modulo 256 (which would be 8-bit integers), 255+5=4 (260 % 256), and 21*61=1 (1281 % 256). Modular arithmetic isn\u2019t very well known by all developers, so I\u2019ll highlight some results as needed. If you want to learn more you can read about it over on wikipedia<\/a>. Modular arithmetic is the way integers work by default on computers. If you multiply two unsigned 32-bit integers, the results is given modulo 2^32.<\/p>\n\n\n\n

So we are searching for a pair of integers (b,c) for which the function has a full cycle. It is important that the function f(x) is invertible, otherwise it might be possible for two different x\u2019s to have the same result, in which case we couldn\u2019t have a full cycle. Bitwise rotation is clearly invertible, and the multiplication by c will be invertible as long as c is odd. This is a result from modular arithmetic, in the integers modulo 2^n, every odd number has a unique inverse. So we immediately know that we need only consider odd values for c.<\/p>\n\n\n\n

I brute forced integers of bit size 3-23, and came up with a list of rotate-multiply constants that have a full cycle. Fortunately, there are definitely such constants for every bit size, suggesting that such constants exist, which I call my first hypothesis.<\/p>\n\n\n\n

Hypothesis 1<\/strong>: There are rotate, multiply constants b and c for any given integer size n such that there is a full cycle that contains every non-zero integer.<\/p>\n\n\n\n

The basis for this is purely empirical. The table below shows the number of rotate-multiply pairs that exists at each bit length with a full cycle.<\/p>\n\n\n\n

Bit Length<\/td>Count<\/td><\/tr>
3<\/td>1<\/td><\/tr>
4<\/td>1<\/td><\/tr>
5<\/td>2<\/td><\/tr>
6<\/td>4<\/td><\/tr>
7<\/td>4<\/td><\/tr>
8<\/td>1<\/td><\/tr>
9<\/td>4<\/td><\/tr>
10<\/td>3<\/td><\/tr>
11<\/td>6<\/td><\/tr>
12<\/td>3<\/td><\/tr>
13<\/td>7<\/td><\/tr>
14<\/td>7<\/td><\/tr>
15<\/td>11<\/td><\/tr>
16<\/td>9<\/td><\/tr>
17<\/td>13<\/td><\/tr>
18<\/td>10<\/td><\/tr>
19<\/td>8<\/td><\/tr>
20<\/td>9<\/td><\/tr>
21<\/td>10<\/td><\/tr>
22<\/td>10<\/td><\/tr>
23<\/td>11<\/td><\/tr><\/tbody><\/table>
Number of full length rotate-multiply pairs at a given bit length<\/figcaption><\/figure>\n\n\n\n

As can be seen, it looks like there are more such pairs as the bit size increases. I didn\u2019t see any a priori reason why such pairs even have to exist, so this is nice to see.<\/p>\n\n\n\n

Now we can get to the first theorem, albeit a trivial one. The number I listed in the table above is actually half the number of rotate-multiply pairs that exist, because every such pair (b,c) has a twin pair (n-b, k), where k is the multiplicative inverse of c. You can see this by just inverting the function f(x)=c*RotateLeft(x,b) for a given bit size n. Let k be the multiplicative inverse of c. Then <\/p>\n\n\n\n

xn+1<\/sub>=c*RotateLeft(xn<\/sub>,b)
kxn+1<\/sub> = RotateLeft(xn<\/sub>,b)
RotateLeft(kxn+1<\/sub>, n-b)=xn<\/sub> <\/p>\n\n\n\n

This is just another recurrence relation, although it’s a little different. It’s going backwards, and the multiply happens, then the rotate. This must have the same length as the original, although it\u2019s a slightly different kind of formula. I noticed this empirically before I saw the math, but I\u2019ll call that a theorem. The key is to notice that the relationship alternates rotate and multiply. You could look at the function as multiply first, then rotate, or rotate first, then multiply. You would get a different sequence, but of the same length.<\/p>\n\n\n\n

I visualize this by thinking of the sequence obtained by starting from an initial value, rotating it, then multiplying it. For instance, for an 8-bit integer with rotate 3 and multiply 21, starting from 1, we get RotateLeft(1,3)=8, then 8 * 21 = 168, then we repeat the process, obtaining the sequence below.<\/p>\n\n\n\n

1,8,168,69,169,77,81,138,82,146,250,215,163,29,97,11,231,…<\/p>\n\n\n\n

The first recurrence relationship describes the sequence 1,168,169,81,82,250,163,97,231. The second relationship, going backwards, describes 11,29,215,146,138,77,69,8. So the sequences are related, but they must be of the same length since they are looking at the same chain of operations.<\/p>\n\n\n\n

Theorem 1<\/strong>: For a given bit size n, if (b, c) is a rotate-multiply pair with a cycle length m, then (n-b, k), where k is the inverse of c, is another rotate-multiply pair with a cycle length m.<\/p>\n\n\n\n

As an example, for 8-bit integers, (3,21) is a full-cycle pair of constants, and so is (5,61), since 3+5=8 and 61 is the multiplicative inverse of 21 modulo 256. The generated sequences are related by the equation above, but are not the same. The first sequence is 1, 168, 169, 81, 82, 250, \u2026 The second is 1, 160, 196, 56, 171, 225. This reduces the search space by half. Only the rotates less or equal to than n\/2 need to be checked, as the twin pair can be easily deduced. Mark Overton has done some research<\/a> on this topic, and his appendix C contains a rotate multiplier pair of (18: 3,731,015,275) for 32 bit integers, with period just shy of max. He notes that rotates greater than 16 are less random. Using this theorem, we can construct the twin pair, which would be \u201cmore random\u201d, and better suited for his purposes \u2013 (14: 583,185,987). With a seed of 1, I have confirmed the period of both of these is 4,294,967,293, as the paper says.<\/p>\n\n\n\n

Hypothesis 2<\/strong>: The multiplier c in a full-cycle pair is always congruent to 1 (mod 4)<\/p>\n\n\n\n

This is another empirical hypothesis, but I observed it for every full-cycle pair for bit size 3 to 21. This is strong enough evidence for me to use it to reduce my search. Now the code ignores constants c that are congruent to 3 (mod 4). Note that c is congruent to 1 (mod 4) is just a fancy way of saying the constant c divided by 4 has remainder 1, or c % 4 = 1 in c-style syntax.<\/p>\n\n\n\n

There will be more articles coming, as I am collecting data and looking through it for patterns that may help me find the constants b and c that work for 64 bit integers. Future articles will discuss cycle statistics, fixed points, roots of unity, and order in cyclic groups. Below is what I have gathered so far. These are full cycle bit length, rotate left, multiply pairs.<\/p>\n\n\n\n

Bit Length<\/td>Rotate<\/td>Multiply<\/td>Bit Length<\/td>Rotate<\/td>Multiply<\/td><\/tr>
3<\/td>1<\/td>5<\/td>17<\/td>5<\/td>60669<\/td><\/tr>
4<\/td>1<\/td>9<\/td>17<\/td>5<\/td>87353<\/td><\/tr>
5<\/td>2<\/td>13<\/td>17<\/td>6<\/td>59053<\/td><\/tr>
5<\/td>2<\/td>17<\/td>17<\/td>6<\/td>65537<\/td><\/tr>
6<\/td>1<\/td>33<\/td>17<\/td>6<\/td>76209<\/td><\/tr>
6<\/td>2<\/td>57<\/td>17<\/td>7<\/td>65537<\/td><\/tr>
6<\/td>3<\/td>29<\/td>17<\/td>7<\/td>95205<\/td><\/tr>
6<\/td>3<\/td>53<\/td>17<\/td>8<\/td>50845<\/td><\/tr>
7<\/td>1<\/td>61<\/td>17<\/td>8<\/td>82897<\/td><\/tr>
7<\/td>1<\/td>65<\/td>18<\/td>2<\/td>225013<\/td><\/tr>
7<\/td>2<\/td>9<\/td>18<\/td>4<\/td>178077<\/td><\/tr>
7<\/td>2<\/td>65<\/td>18<\/td>5<\/td>18125<\/td><\/tr>
8<\/td>3<\/td>21<\/td>18<\/td>5<\/td>112837<\/td><\/tr>
9<\/td>2<\/td>105<\/td>18<\/td>5<\/td>131073<\/td><\/tr>
9<\/td>2<\/td>257<\/td>18<\/td>5<\/td>192957<\/td><\/tr>
9<\/td>2<\/td>289<\/td>18<\/td>6<\/td>143697<\/td><\/tr>
9<\/td>3<\/td>241<\/td>18<\/td>7<\/td>182433<\/td><\/tr>
10<\/td>1<\/td>637<\/td>18<\/td>9<\/td>68729<\/td><\/tr>
10<\/td>3<\/td>513<\/td>18<\/td>9<\/td>237001<\/td><\/tr>
10<\/td>4<\/td>1009<\/td>19<\/td>2<\/td>519821<\/td><\/tr>
11<\/td>1<\/td>225<\/td>19<\/td>4<\/td>59753<\/td><\/tr>
11<\/td>1<\/td>237<\/td>19<\/td>5<\/td>14177<\/td><\/tr>
11<\/td>1<\/td>1813<\/td>19<\/td>5<\/td>128565<\/td><\/tr>
11<\/td>4<\/td>1081<\/td>19<\/td>5<\/td>323697<\/td><\/tr>
11<\/td>4<\/td>1165<\/td>19<\/td>7<\/td>211525<\/td><\/tr>
11<\/td>5<\/td>1025<\/td>19<\/td>8<\/td>409841<\/td><\/tr>
12<\/td>1<\/td>1625<\/td>19<\/td>9<\/td>228385<\/td><\/tr>
12<\/td>3<\/td>725<\/td>20<\/td>1<\/td>634197<\/td><\/tr>
12<\/td>5<\/td>3561<\/td>20<\/td>1<\/td>940945<\/td><\/tr>
13<\/td>1<\/td>7897<\/td>20<\/td>1<\/td>958881<\/td><\/tr>
13<\/td>2<\/td>4033<\/td>20<\/td>2<\/td>283877<\/td><\/tr>
13<\/td>3<\/td>561<\/td>20<\/td>3<\/td>497933<\/td><\/tr>
13<\/td>3<\/td>1965<\/td>20<\/td>6<\/td>727193<\/td><\/tr>
13<\/td>4<\/td>637<\/td>20<\/td>7<\/td>167493<\/td><\/tr>
13<\/td>4<\/td>905<\/td>20<\/td>7<\/td>524289<\/td><\/tr>
13<\/td>4<\/td>5429<\/td>20<\/td>7<\/td>950113<\/td><\/tr>
14<\/td>1<\/td>7457<\/td>21<\/td>2<\/td>78437<\/td><\/tr>
14<\/td>3<\/td>1629<\/td>21<\/td>2<\/td>737153<\/td><\/tr>
14<\/td>3<\/td>9901<\/td>21<\/td>4<\/td>723317<\/td><\/tr>
14<\/td>3<\/td>13377<\/td>21<\/td>6<\/td>321549<\/td><\/tr>
14<\/td>5<\/td>1965<\/td>21<\/td>6<\/td>1523857<\/td><\/tr>
14<\/td>7<\/td>1957<\/td>21<\/td>7<\/td>1740677<\/td><\/tr>
14<\/td>7<\/td>2093<\/td>21<\/td>8<\/td>1933937<\/td><\/tr>
15<\/td>1<\/td>12957<\/td>21<\/td>9<\/td>518925<\/td><\/tr>
15<\/td>1<\/td>16385<\/td>21<\/td>10<\/td>286961<\/td><\/tr>
15<\/td>1<\/td>20121<\/td>21<\/td>10<\/td>1048577<\/td><\/tr>
15<\/td>2<\/td>1929<\/td>22<\/td>1<\/td>2097153<\/td><\/tr>
15<\/td>2<\/td>16385<\/td>22<\/td>3<\/td>1458649<\/td><\/tr>
15<\/td>4<\/td>13609<\/td>22<\/td>3<\/td>2107557<\/td><\/tr>
15<\/td>4<\/td>16385<\/td>22<\/td>6<\/td>1359401<\/td><\/tr>
15<\/td>5<\/td>4781<\/td>22<\/td>7<\/td>547981<\/td><\/tr>
15<\/td>5<\/td>8681<\/td>22<\/td>7<\/td>2383549<\/td><\/tr>
15<\/td>6<\/td>4305<\/td>22<\/td>8<\/td>1358145<\/td><\/tr>
15<\/td>6<\/td>31173<\/td>22<\/td>8<\/td>1690877<\/td><\/tr>
16<\/td>1<\/td>5977<\/td>22<\/td>8<\/td>2158689<\/td><\/tr>
16<\/td>1<\/td>31373<\/td>22<\/td>9<\/td>3168081<\/td><\/tr>
16<\/td>1<\/td>54205<\/td>23<\/td>1<\/td>2502269<\/td><\/tr>
16<\/td>1<\/td>55833<\/td>23<\/td>5<\/td>1856189<\/td><\/tr>
16<\/td>1<\/td>56373<\/td>23<\/td>5<\/td>4194305<\/td><\/tr>
16<\/td>2<\/td>13233<\/td>23<\/td>6<\/td>716037<\/td><\/tr>
16<\/td>2<\/td>55921<\/td>23<\/td>6<\/td>7071101<\/td><\/tr>
16<\/td>5<\/td>17497<\/td>23<\/td>8<\/td>1904041<\/td><\/tr>
16<\/td>5<\/td>23269<\/td>23<\/td>9<\/td>2413621<\/td><\/tr>
17<\/td>1<\/td>39077<\/td>23<\/td>9<\/td>4194305<\/td><\/tr>
17<\/td>3<\/td>38713<\/td>23<\/td>10<\/td>5903105<\/td><\/tr>
17<\/td>3<\/td>65537<\/td>23<\/td>10<\/td>7835097<\/td><\/tr>
17<\/td>4<\/td>82981<\/td>23<\/td>11<\/td>6768185<\/td><\/tr><\/tbody><\/table>
Sets of bitlength, rotate, and multiply pairs that are full cycle<\/figcaption><\/figure>\n\n\n\n

<\/p>\n","protected":false},"excerpt":{"rendered":"

I have been playing with genetic programming for several years, attempting to use it to create pseudo random number generators (RNGs) and hash functions. In the course of doing this, with various parameters, I frequently encountered the pseudorandom number generator given by combining a bitwise rotation and a multiply. Sample C# code below, with rotation […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","om_disable_all_campaigns":false,"WB4WB4WP_MODE":"","WB4WP_PAGE_SCRIPTS":"","WB4WP_PAGE_STYLES":"","WB4WP_PAGE_FONTS":"","WB4WP_PAGE_HEADER":"","WB4WP_PAGE_FOOTER":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-121","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"\nCharacterizing the Rotate-Multiply Iterated Function Part I - Ender314's Random Number Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ender314.com\/?p=121\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Characterizing the Rotate-Multiply Iterated Function Part I - Ender314's Random Number Blog\" \/>\n<meta property=\"og:description\" content=\"I have been playing with genetic programming for several years, attempting to use it to create pseudo random number generators (RNGs) and hash functions. In the course of doing this, with various parameters, I frequently encountered the pseudorandom number generator given by combining a bitwise rotation and a multiply. Sample C# code below, with rotation […]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ender314.com\/?p=121\" \/>\n<meta property=\"og:site_name\" content=\"Ender314's Random Number Blog\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-11T00:48:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-06-14T17:51:59+00:00\" \/>\n<meta name=\"author\" content=\"Ender314\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ender314\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ender314.com\/?p=121\",\"url\":\"https:\/\/ender314.com\/?p=121\",\"name\":\"Characterizing the Rotate-Multiply Iterated Function Part I - Ender314's Random Number Blog\",\"isPartOf\":{\"@id\":\"https:\/\/ender314.com\/#website\"},\"datePublished\":\"2023-06-11T00:48:47+00:00\",\"dateModified\":\"2023-06-14T17:51:59+00:00\",\"author\":{\"@id\":\"https:\/\/ender314.com\/#\/schema\/person\/a9a77c40aeab4681ad07b8f92765cc8f\"},\"breadcrumb\":{\"@id\":\"https:\/\/ender314.com\/?p=121#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ender314.com\/?p=121\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ender314.com\/?p=121#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ender314.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Characterizing the Rotate-Multiply Iterated Function Part I\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ender314.com\/#website\",\"url\":\"https:\/\/ender314.com\/\",\"name\":\"Ender314's Random Number Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ender314.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/ender314.com\/#\/schema\/person\/a9a77c40aeab4681ad07b8f92765cc8f\",\"name\":\"Ender314\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ender314.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/eaf7d249d72a7ef23f2b690d8def661a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/eaf7d249d72a7ef23f2b690d8def661a?s=96&d=mm&r=g\",\"caption\":\"Ender314\"},\"url\":\"https:\/\/ender314.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Characterizing the Rotate-Multiply Iterated Function Part I - Ender314's Random Number Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ender314.com\/?p=121","og_locale":"en_US","og_type":"article","og_title":"Characterizing the Rotate-Multiply Iterated Function Part I - Ender314's Random Number Blog","og_description":"I have been playing with genetic programming for several years, attempting to use it to create pseudo random number generators (RNGs) and hash functions. In the course of doing this, with various parameters, I frequently encountered the pseudorandom number generator given by combining a bitwise rotation and a multiply. Sample C# code below, with rotation […]","og_url":"https:\/\/ender314.com\/?p=121","og_site_name":"Ender314's Random Number Blog","article_published_time":"2023-06-11T00:48:47+00:00","article_modified_time":"2023-06-14T17:51:59+00:00","author":"Ender314","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Ender314","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/ender314.com\/?p=121","url":"https:\/\/ender314.com\/?p=121","name":"Characterizing the Rotate-Multiply Iterated Function Part I - Ender314's Random Number Blog","isPartOf":{"@id":"https:\/\/ender314.com\/#website"},"datePublished":"2023-06-11T00:48:47+00:00","dateModified":"2023-06-14T17:51:59+00:00","author":{"@id":"https:\/\/ender314.com\/#\/schema\/person\/a9a77c40aeab4681ad07b8f92765cc8f"},"breadcrumb":{"@id":"https:\/\/ender314.com\/?p=121#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ender314.com\/?p=121"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/ender314.com\/?p=121#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ender314.com\/"},{"@type":"ListItem","position":2,"name":"Characterizing the Rotate-Multiply Iterated Function Part I"}]},{"@type":"WebSite","@id":"https:\/\/ender314.com\/#website","url":"https:\/\/ender314.com\/","name":"Ender314's Random Number Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ender314.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ender314.com\/#\/schema\/person\/a9a77c40aeab4681ad07b8f92765cc8f","name":"Ender314","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ender314.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/eaf7d249d72a7ef23f2b690d8def661a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/eaf7d249d72a7ef23f2b690d8def661a?s=96&d=mm&r=g","caption":"Ender314"},"url":"https:\/\/ender314.com\/?author=1"}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/ender314.com\/index.php?rest_route=\/wp\/v2\/posts\/121"}],"collection":[{"href":"https:\/\/ender314.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ender314.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ender314.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ender314.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=121"}],"version-history":[{"count":4,"href":"https:\/\/ender314.com\/index.php?rest_route=\/wp\/v2\/posts\/121\/revisions"}],"predecessor-version":[{"id":133,"href":"https:\/\/ender314.com\/index.php?rest_route=\/wp\/v2\/posts\/121\/revisions\/133"}],"wp:attachment":[{"href":"https:\/\/ender314.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=121"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ender314.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=121"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ender314.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=121"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}