A more efficient algorithm is presented in (Kuhlmann and , working in time O(|p|) in case of f = 2.
this algorithm works for a restricted typology of productions, and does not cover all cases in which some binarization is possible.