3 ms·
Here are the results for numbers up to 50: http://codepad.org/NBmpZGpT http://codepad.org/NBmpZGpT The advantage simply comes from getting a better initial gu
by scythe 4y ago
Here are the results for numbers up to 50:
http://codepad.org/NBmpZGpT http://codepad.org/NBmpZGpT
The advantage simply comes from getting a better initial guess in some cases. When the test number is halfway between two perfect squares, the advantage is maximized -- for 30 we get 5.5 for the one method and 5.47727~ for the other, with a true value of 5.47722~. For some numbers, like 35, the integer square is closer than the half-integer, so the results are the same, but these are also the numbers with the best approximations to start with.