Comment Comment by archgoon So fun fact, if you compile int sum(int n) { int sum = 0; for(int i = 0; i < n; i++) { sum +=i; } return sum; } clang, with -O2, will turn this into the polynomial (n+1)*n//2. It can also do similar transformations for multiple loops.https://godbolt.org/z/so6neac33So if you do a brute force solution which could have been reduced to a polyomial, clang has a shot of doing just that. parent archgoon 2 years ago
https://godbolt.org/z/so6neac33
So if you do a brute force solution which could have been reduced to a polyomial, clang has a shot of doing just that.