|
|
|
|
|
by ianthehenry
671 days ago
|
|
Are there any existing compilers that could compile a function like this -- non-tail recursive and non-tail recursive modulo cons -- into something that executes in sub-exponential time? How would that even work? I've never heard of a compiler sufficiently smart to optimize a definition like this and now I'm very curious |
|
And, well, if you disregard heavy optimizations, then this "insanely-recursive" function is actually a somewhat decent way to measure the efficiency of the function calls and arithmetic.
[0] https://godbolt.org/z/3fce1qTdv
[1] https://godbolt.org/z/4jqa453qY