User blog comment:QuasarBooster/Did I translate this mathematica code right?/@comment-30004975-20190910184540/@comment-30004975-20190910184704

Alternatively, use while 2*y>v: and insert y=y-1/denominator(y) before the beginning and end of the loop (:= isn't supported in versions older than 3.8)