Checking numerical values of means. To compare with values in script file a3q1script.html.

Course: Math 2120, Fall 2004, Instructor: S.Sadov, Date: Nov 12, 2004.

(Part of Solutions/Comments to Assignment 3).

Test #1

> 1.0/(0.5*(1.0+1/4.0)); harmonic mean

.8000000000

> GaussAGM(1.0,4.0);

2.243028580

Test #6

> 1.0/(0.5*(1/0.25+1/0.4)); harmonic mean

.3076923077

Test #7

> GaussAGM(2.0,3.0);

2.474680436

Test #10 -- Maple is OK with it

> (2.0+2.0E+7)/2;
(2.0*2.0E+7)^(1/2);
((1/2+1/2.0E+7)/2)^(-1);
GaussAGM(2.0,2.0E+7);

10000001.00

6324.555320

3.999999600

1794745.576

Test #11

> (2.0+2.0E+6)/2;
(2.0*2.0E+6)^(1/2);
((1/2+1/2.0E+6)/2)^(-1);
GaussAGM(2.0,2.0E+6);

1000001.000

2000.000000

3.999996000

206659.1875

Tests #12-13

> (2.0+1.0E+7)/2;
(2.0*1.0E+7)^(1/2);
((1/2+1/1.0E+7)/2)^(-1);
GaussAGM(2.0,1.0E+7);

5000001.000

4472.135955

3.999999200

934372.5164

>