(tak x y z)
In computer science, the tak function is a recursive function, named after Ikuo Takeuchi.
This function is often used as a benchmark for languages with optimization for recursion, as also with Inlab Scheme with its benchmark functionality.
The result is returned as a number.
(define (tak x y z)
(if (not (< y x))
z
(tak (tak (1- x) y z)
(tak (1- y) z x)
(tak (1- z) x y))))
> (tak 18 12 6)
7
>