#! ./sizzle -s
!#
;; benchmark/tak.scm
;;
;; The famous tak benchmark, used for testing Sizzle.
;;
;; Copyright (C) 2000 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
;;
;; This is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; 
;; This software is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.
;; 
;; You should have received a copy of the GNU General Public License
;; along with this package; see the file COPYING.  If not, write to
;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.  

(define tak
  (lambda (x y z)
    (if (>= y x) z
	(tak (tak (- x 1) y z)
	     (tak (- y 1) z x)
	     (tak (- z 1) x y)))))

(define test-tak
  (lambda ()
    (tak 18 12 6)))

(test-tak)
(test-tak)
(test-tak)
(test-tak)
(test-tak)
(test-tak)
(test-tak)
(test-tak)
(test-tak)
(test-tak)
(test-tak)
(test-tak)
(test-tak)
(test-tak)
(test-tak)
(test-tak)
(test-tak)
(test-tak)
(test-tak)
(test-tak)

(display "gc-stats: ") 
(display (gc-stats)) 
(newline)
(display "profile-stats: ") 
(display (profile-stats)) 
(newline)
