Ok, that's not the regular `lgamma` (I don't understand MSVC...). Let's go with Cook's code.