# Re: Fortran vs. Octave/Matlab

*From*: Ron Shepard <ron-shepard@xxxxxxxxxxxxxxxxxx>*Date*: Tue, 03 Nov 2009 15:19:49 -0500

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

.

**Follow-Ups**:**Re: Fortran vs. Octave/Matlab***From:*nmm1

**References**:**Fortran vs. Octave/Matlab***From:*Florian Xaver

**Re: Fortran vs. Octave/Matlab***From:*user1

**Re: Fortran vs. Octave/Matlab***From:*frank

**Re: Fortran vs. Octave/Matlab***From:*TideMan

**Re: Fortran vs. Octave/Matlab***From:*nmm1

**Re: Fortran vs. Octave/Matlab***From:*mecej4

- Prev by Date:
**Overloading OPERATOR(+): my usage causing memory leaks.** - Next by Date:
**Re: Overloading OPERATOR(+): my usage causing memory leaks.** - Previous by thread:
**Re: Fortran vs. Octave/Matlab** - Next by thread:
**Re: Fortran vs. Octave/Matlab** - Index(es):