Math.log2() does not be supported on some version of Sarifa  changed to Math.log(a)/Math.log(2)