Hubbry Logo
search
logo

Tak (function)

logo
Community Hub0 Subscribers
Write something...
Be the first to start a discussion here.
Be the first to start a discussion here.
See all
Tak (function)

In computer science, the Tak function is a recursive function, named after Ikuo Takeuchi [ja]. It is defined as follows:

This function is often used as a benchmark for languages with optimization for recursion.

The original definition by Takeuchi was as follows:

tarai is short for たらい回し (tarai mawashi, "to pass around") in Japanese.

John McCarthy named this function tak() after Takeuchi.

However, in certain later references, the y somehow got turned into the z. This is a small, but significant difference because the original version benefits significantly from lazy evaluation.

Though written in exactly the same manner as others, the Haskell code below runs much faster.

See all
User Avatar
No comments yet.