Expecting to copy/paste mathematical equations or formulas from a wikipedia page or a DAFx conference paper and get a working implementation, is unrealistic.
Window functions are often implemented with look-up tables, not by direct function evaluation. In DSP often formulas
are approximated when implementing them. Or some formula's don't even describe an implementation.
I do know that it probably had to be adjusted a bit and not DIRECTLY copy pasting. BUt you get the idea I am sure.