Ackermann F (standard)

by Ricardo Fernández Serrata

Version 5 (June 5, 2021)

Download (36 downloads)

This function can easily cause overflows of many kinds in many programming languages, so be careful.

As you can see, there is an obvious speed and memory killer, which is the tail-call (the subroutine at the bottom of the flow). That call is there because this is the verbatim definition.

The variables "out" and "n" can be merged into 1 var without affecting the computation. They aren't merged here because I wanted to preserve a copy of the original input argument (n) to print it when halting.

ℹ en.wikipedia.org/wiki/Ackermann_function

Optimized: llamalab.com/automate/community/flows/39647

3.0 average rating from 1 reviews

5 stars
0
4 stars
0
3 stars
1
2 stars
0
1 star
0
Reports
0

Rate and review within the app in the Community section.