summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/codeGen/should_run/3561.hs
blob: 44258a839c66e58c9168fbea2c24a4bcdc5f7cdd (plain)
1
2
3
4
5
6
7
8
9
10
main = print $ pqr' 0 1

pqr' :: Int -> Int -> Integer
pqr' a b | a == b - 1 = rab
         | otherwise = ram * rmb
    where m = (a + b) `div` 2
          ram = pqr' a m
          rmb = pqr' m b
          rab = toInteger (6 * b - 5) * toInteger (2 * b - 1) *
                toInteger (6 * b - 1)