Message from C, C++ talks

July 2019

— Exactly

— The thing is O(1), just that it is implemented pretty poorly

— Yeah, since in source it's array traverse

— Or by someone who doesn’t know Σn


No, the fact you program a summation with an O(n) algorithm and the compiler deduces the formula is quite amazing

— Isnt it like hardcoded?

— There is no way to use popcnt tho, is there? Without inline asm

— No

— Oh

— It's pretty fucking smart tbh

— Wait so if i sum like n^5 it can collapse it to like a sextic for me

— They use some heuristics to recognise pattern. Same for popcnt

— Yep

— That’s pretty impressive

— Because of the intermediate representation