Xerl[b_, a_] :=
Module[{b2, s, n, x},
b2 = 1;
s = 1/a;
For[x = s, b2 > b, x+=s,
b2 /= x + b2];
x -= s;
n = x*a - 1;
x /. FindRoot[Berld[x, a] == b, {x, {n, n+1}}]
] /; (0 < b < 1)
(* needs also the definition of the function
Berld *)