The comment for the WI parameter says that "...if H(i:i+1,i:i+1) is a 2-by-2 diagonal block, WI(i) = sqrt(H(i+1,i)*H(i,i+1)) ...".

However, the product of the off-diagonal elements in the 2x2 block is negative, so it should say "...WI(i) = SQRT(ABS(H(i+1,i)*H(i,i+1)))..." instead.