Skip to content

Instantly share code, notes, and snippets.

View resistance-shimako's full-sized avatar

Resistance Shimako resistance-shimako

  • Japan
  • 01:03 (UTC +09:00)
View GitHub Profile
@andanteyk
andanteyk / ibukihash.hlsl
Created December 19, 2024 10:00
IbukiHash
// 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;
@Marc-B-Reynolds
Marc-B-Reynolds / gist:53ecc4f9648d9ba4348403b9afd06804
Last active May 15, 2025 06:19
LCG/MCG multiplier tables for 32 & 64 bits
// 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
@publik-void
publik-void / sin-cos-approximations-gist.adoc
Last active March 5, 2026 13:24
Fast MiniMax Polynomial Approximations of Sine and Cosine

Fast MiniMax Polynomial Approximations of Sine and Cosine

@meepen
meepen / lujlu.lua
Last active February 25, 2026 15:10
LuaJit VM in Lua. Comes with fully operational bytecode interpreter. License is: contact me before using it commercially. - Now runs itself inside itself and itself inside itself inside itself
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,