It is better to devise as f to compute the ratio Z(l1)/Z (l2) for two different l1, l2r. Such a function is given here. Given a target value l, intermediate values l0, l1, , lr, are computed here and then we have the following.