Improved @schickling improvement.

1) Moved check outside of loop
2) Adjusted index: Please note that I did not check for b/a = 1/3, but for a/b = 3, to prevent numerical errors.