This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // IbukiHash by Andante (https://twitter.com/andanteyk) | |
| // This work is marked with CC0 1.0. To view a copy of this license, visit https://creativecommons.org/publicdomain/zero/1.0/ | |
| float ibuki(float4 v) | |
| { | |
| const uint4 mult = | |
| uint4(0xae3cc725, 0x9fe72885, 0xae36bfb5, 0x82c1fcad); | |
| uint4 u = uint4(v); | |
| u = u * mult; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 1) "Tables of linear congruential generators of different sizes and good lattice structure" (1999), Pierre L'Ecuyer | |
| // 2) Pre-print version of (3) (https://arxiv.org/abs/2001.05304) | |
| // 3) "Computationally easy, spectrally good multipliers for congruential pseudorandom number generators" (2021), Guy L. Steele Jr. & Sebastiano Vigna (https://onlinelibrary.wiley.com/doi/epdf/10.1002/spe.3030) | |
| // inline comment number is bit width of constant | |
| const uint32_t lcg_mul_k_table_32[] = | |
| { | |
| // (3) Table 4 LCGs | |
| 0x0000d9f5, // 16 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local bytecodes = {} | |
| local BC, run_function = {} | |
| local VARG_CONST = {} | |
| local lujlu_mt_funcs | |
| local lujlu_cache = setmetatable({}, {__mode = "k"}) | |
| local lujlu_identifier_mt = { | |
| __tostring = function(self) | |
| return tostring(lujlu_cache[self].data) | |
| end, |