User blog comment:Alemagno12/A program-free definition for BM2?/@comment-35870936-20180709230304

The program is wrong. The problem is this line: 2 - If ak <= bk, then ck = 0. Otherwise, ck = 1. The condition for ck = 0 is more complicated than just ak <= bk. I think it involves seeing if the bad root is discarded with respect to the current element (or something of that sort).

An explicit example of how this algorithm gives a different value of the C matrix is (0,0,0)(1,1,1)(2,1,0)(3,2,1)(4,1,0)(5,2,0)(6,3,0)(3,2,1).