From a1adae8d2870feb5d9bc7f41e1295a2ab0dcd144 Mon Sep 17 00:00:00 2001 From: Alejandro Jackson <84302777+alejack312@users.noreply.github.com> Date: Wed, 4 Dec 2024 23:36:07 -0500 Subject: [PATCH] Update ajacks41-inlining-unrolling.lisp --- benchmarks/ajacks41-inlining-unrolling.lisp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/benchmarks/ajacks41-inlining-unrolling.lisp b/benchmarks/ajacks41-inlining-unrolling.lisp index dfabd07..83257a3 100644 --- a/benchmarks/ajacks41-inlining-unrolling.lisp +++ b/benchmarks/ajacks41-inlining-unrolling.lisp @@ -1,3 +1,6 @@ -(define (add_pair_elements p) (+ (left p) (right p))) -(define (sum n acc) (if (= n 0) acc (sum (sub1 n) (+ acc n)))) -(print (+ (add_pair_elements (pair 5 5)) (sum 3 0))) +(define (pairadd p) (+ (left p) (right p))) +(define (sum n acc) + (if (= n 0) + acc + (sum (- n 1) (+ acc n)))) +(print (+ (pairadd (pair 5 5)) (sum 3 0)))