Fix some robustness bugs in the implementation of Ritters's method.
Fix some robustness bugs in the implementation of Ritters's method.

bos/statistics,Shimuuar/statistics,mihaimaruseac/statistics,fpco/statistics,bos/statistics,mihaimaruseac/statistics,mihaimaruseac/statistics,fpco/statistics,Shimuuar/statistics