Skip to content

Commit 0a34059

Browse files
committed
Drop manual unrolling
We don't get specialization and gains are relatively small. Let go with simpler solution
1 parent d3c97c2 commit 0a34059

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

Statistics/Sample.hs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -453,12 +453,6 @@ pair va vb
453453

454454
-- (^) operator from Prelude is just slow.
455455
(^) :: Double -> Int -> Double
456-
x ^ 1 = x
457-
x ^ 2 = x * x
458-
x ^ 3 = x * x * x
459-
x ^ 4 = (x * x) * (x * x)
460-
x ^ 5 = (x * x) * x * (x * x)
461-
-- x ^ n = x * (x ^ (n-1))
462456
x0 ^ n0 = go (n0-1) x0 where
463457
go 0 !acc = acc
464458
go n acc = go (n-1) (acc*x0)

0 commit comments

Comments
 (0)