Skip to content

Instantly share code, notes, and snippets.

@LCamel
Created March 23, 2023 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LCamel/76db02fd464aa56cfad03be795a21762 to your computer and use it in GitHub Desktop.
Save LCamel/76db02fd464aa56cfad03be795a21762 to your computer and use it in GitHub Desktop.
collision cost
// https://discord.com/channels/943612659163602974/1065263015622090802/1088499598579990589
let f = (x) => 4 * 2**x * 2**(129/4 - x/8) + 2**(129 - x/2);
for (let x = 0; x <= 256; x++) {
console.log(x, Math.log2(f(x)));
}
0 129
1 128.5
2 128
3 127.5
4 127
5 126.5
6 126
7 125.5
8 125
9 124.5
10 124
11 123.5
12 123
13 122.5
14 122
15 121.5
16 121
17 120.5
18 120
19 119.5
20 119
21 118.5
22 118
23 117.5
24 117
25 116.5
26 116
27 115.5
28 115
29 114.5
30 114
31 113.5
32 113
33 112.5
34 112
35 111.50000000000001
36 111.00000000000003
37 110.50000000000009
38 110.00000000000023
39 109.5000000000006
40 109.00000000000156
41 108.50000000000405
42 108.0000000000105
43 107.50000000002723
44 107.00000000007061
45 106.50000000018315
46 106.00000000047504
47 105.5000000012321
48 105.00000000319567
49 104.50000000828855
50 104.00000002149783
51 103.50000005575848
52 103.00000014461959
53 102.50000037509677
54 102.00000097288046
55 101.50000252333837
56 101.0000065447209
57 100.50001697484451
58 100.00004402688683
59 99.5001141888399
60 99.00029615053137
61 98.5007679938396
62 98.00199108526088
63 97.5051585678958
64 97.01334173742217
65 96.53435243259956
66 96.08746284125034
67 95.71674035775277
68 95.50634622894941
69 95.5638533798361
70 95.93675179543982
71 96.55936087560107
72 97.32389702779413
73 98.1539412601786
74 99.01122725542325
75 99.8793390541384
76 100.75167448022276
77 101.62564583061184
78 102.50024903598673
79 103.37509602159072
80 104.25003702214119
81 105.12501427409926
82 106.00000550343434
83 106.87500212186649
84 107.75000081809173
85 108.62500031541754
86 109.5000001216101
87 110.3750000468871
88 111.25000001807744
89 112.12500000696981
90 113.00000000268723
91 113.87500000103607
92 114.75000000039945
93 115.62500000015402
94 116.50000000005937
95 117.3750000000229
96 118.25000000000882
97 119.1250000000034
98 120.00000000000131
99 120.87500000000051
100 121.7500000000002
101 122.62500000000007
102 123.50000000000003
103 124.37500000000001
104 125.25
105 126.125
106 127
107 127.875
108 128.75
109 129.625
110 130.5
111 131.375
112 132.25
113 133.125
114 134
115 134.875
116 135.75
117 136.625
118 137.5
119 138.375
120 139.25
121 140.125
122 141
123 141.875
124 142.75
125 143.625
126 144.5
127 145.375
128 146.25
129 147.125
130 148
131 148.875
132 149.75
133 150.625
134 151.5
135 152.375
136 153.25
137 154.125
138 155
139 155.875
140 156.75
141 157.625
142 158.5
143 159.375
144 160.25
145 161.125
146 162
147 162.875
148 163.75
149 164.625
150 165.5
151 166.375
152 167.25
153 168.125
154 169
155 169.875
156 170.75
157 171.625
158 172.5
159 173.375
160 174.25
161 175.125
162 176
163 176.875
164 177.75
165 178.625
166 179.5
167 180.375
168 181.25
169 182.125
170 183
171 183.875
172 184.75
173 185.625
174 186.5
175 187.375
176 188.25
177 189.125
178 190
179 190.875
180 191.75
181 192.625
182 193.5
183 194.375
184 195.25
185 196.125
186 197
187 197.875
188 198.75
189 199.625
190 200.5
191 201.375
192 202.25
193 203.125
194 204
195 204.875
196 205.75
197 206.625
198 207.5
199 208.375
200 209.25
201 210.125
202 211
203 211.875
204 212.75
205 213.625
206 214.5
207 215.375
208 216.25
209 217.125
210 218
211 218.875
212 219.75
213 220.625
214 221.5
215 222.375
216 223.25
217 224.125
218 225
219 225.875
220 226.75
221 227.625
222 228.5
223 229.375
224 230.25
225 231.125
226 232
227 232.875
228 233.75
229 234.625
230 235.5
231 236.375
232 237.25
233 238.125
234 239
235 239.875
236 240.75
237 241.625
238 242.5
239 243.375
240 244.25
241 245.125
242 246
243 246.875
244 247.75
245 248.625
246 249.5
247 250.375
248 251.25
249 252.125
250 253
251 253.875
252 254.75
253 255.625
254 256.5
255 257.375
256 258.25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment