Re: Fortran vs. Octave/Matlab



In article <hcphch$uhj$1@xxxxxxxxxxxxxxxxxxxxxxxxxx>,
mecej4 <mecej4_no_spam@xxxxxxxxxxxxx> wrote:

As usual, Google can tell us:
http://www.itl.nist.gov/div897/sqg/dads/HTML/squareRoot.html

It's also a stupid way to do it, and has been for 300 years.

It requires only addition and multiplication, steps that are easy to do
by hand.

One can justify changing that to "3,000 years" if one is willing to take
Heron's (Heron of Alexandria, Century 1) word that the Babylonians knew
the use of x_{n+1} = (x_n + N/x_n)/2 .

This is a different algorithm. This is (now called) Newton's method,
which converges quadratically, meaning that the number of correct digits
doubles in each step. In the above algorithm, in contrast, there is one
new correct digit generated each step. But Newton's method requires a
division, N/x_n, which is difficult to do by hand compared to additions
and multiplications. (The other division, by the integer value 2, is
easy.)

Newton's method became popular in the 70's with the spread of the four
function calculator, which eliminated the disadvantage of doing the
division step. Before that, it was used mostly only by computer
programmers or people with mechanical calculators.

$.02 -Ron Shepard
.