Talk:Square root algorithms: Difference between revisions

Content deleted Content added
Complexity ?: or Babylonian again?
Isheden (talk | contribs)
Line 238:
 
The first sentence presently reads "In numerical analysis, a branch of mathematics, there are several methods for calculating the principal square root of a nonnegative real number". This is in my view really awkward and seems to originate in an attempt to make the article title "Methods of computing square roots" the subject of the first sentence. The real subject of this article is ''square root algorithms'', and "methods for calculating the principal square root of a nonnegative real number" is just a description/definition of this subject. Thus, since "square root algorithm" is a widely accepted name for the subject, a more logical way of structuring the first sentence would be "square root algorithms are methods for calculating the principal square root of a nonnegative real number", or even better in singular. Further information on how to write the first sentence can be found in [[WP:LEAD]], particularly [[WP:FIRSTSENTENCE]]. [[User:Isheden|Isheden]] ([[User talk:Isheden|talk]]) 12:13, 28 March 2013 (UTC)
 
== Regarding the section "Rough estimation" ==
 
With <math>S</math> expressed in [[scientific notation]] as <math> S = a\times10^{2n}</math> where <math> 1\leq a<100</math>, an estimate for <math>\sqrt{S} = \sqrt{a}\times10^n</math> is <math>\sqrt{S} \approx 3\times10^n</math>. The factor three is used because it approximates the [[geometric mean]] of the lowest and highest possible values with the given number of digits: <math>\sqrt{\sqrt{1} \cdot \sqrt{100}} = \sqrt[4]{100} \approx 3</math>.
 
Expressed as a binary number, we have <math> S = a\times10_b^{2n}</math> where <math> 1\leq a<100_b</math>, an estimate for <math>\sqrt{S} = \sqrt{a}\times2^n</math> is <math>\sqrt{S} \approx 2^n</math>, since the [[geometric mean]] of the lowest and highest possible values with the given number of digits is <math>\sqrt{\sqrt{1} \cdot \sqrt{100_b}} = \sqrt[4]{4} = \sqrt{2} \approx 1.4</math>, which is close to one.
 
Slightly improved estimates can be obtained by expressing math>S</math> in normalized scientific notation as <math> S = a\times10^b</math> where <math> 1\leq a<10</math>, and treating the cases <math>b = 2n</math> (even) and <math>b = 2n + 1</math> (odd) differently. Then the estimates are
:<math> \sqrt{S} \approx \begin{cases}
2 \cdot 10^n & \text{if } b = 2n, \\
6 \cdot 10^n & \text{if } b = 2n + 1. \\
\end{cases}</math>
In the binary case we obtain
:<math> \sqrt{S} \approx \begin{cases}
1 \cdot 2^n & \text{if } b = 2n, \\
2 \cdot 2^n & \text{if } b = 2n + 1. \\
\end{cases}</math>
 
To discuss: Is it relevant in practice to treat the odd and even cases differently? Is the difference more relevant in the decimal case than for binary numbers? [[User:Isheden|Isheden]] ([[User talk:Isheden|talk]]) 14:13, 13 July 2013 (UTC)