Last active
September 13, 2022 01:28
-
-
Save g000001/af5268faac15491f9dccfd9f4e2d9250 to your computer and use it in GitHub Desktop.
Tarai(inlined)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun tarai (x y z) | |
(declare (optimize (speed 3) (debug 0) (safety 0))) | |
(labels ((tarai (x y z) | |
(declare (fixnum x y z)) | |
(the fixnum | |
(if (> x y) | |
(tarai (tarai (1- x) y z) | |
(tarai (1- y) z x) | |
(tarai (1- z) x y)) | |
y)))) | |
(declare (inline tarai)) | |
(tarai x y z))) | |
(compile 'tarai) | |
(princ (time (tarai 14 7 0))) | |
(terpri) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment