Code doesn't have to look like that, look at the Haskell version:
gcd x y | x == y = x
| x > y = gcd (x - y) y
| otherwise = gcd x (y - x)
Much more close to the math notation.