Interesting, but good thing Smath 5346 does it as well w/o all that complexity. Shouldn't it be constructed around "While" loop ? Remember that any invented iterative solver for Smath can't exceed better accuracy than around 12 decimals because of the granularty of Smath.
The native Smath 'solve' has a universal structure wrt: 1. is implicit 2. the bracketing [x1,x2] 3. very easy to handle.