Skip to content

Instantly share code, notes, and snippets.

@hebiyan
Created April 16, 2014 08:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hebiyan/10829182 to your computer and use it in GitHub Desktop.
Save hebiyan/10829182 to your computer and use it in GitHub Desktop.
(defun tarai (x y z)
(declare (optimize (speed 3) (safety 0)))
(if (<= x y)
y
(tarai (tarai (1- x) y z)
(tarai (1- y) z x)
(tarai (1- z) x y))))
(compile 'tarai)
(print (tarai 12 6 0))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment