% sample2.m
% We're seeking square root of z.
%
z = input ( ' Please enter z:' );

x = z;
y = z / x;

x = ( x + y ) / 2.0;
y = z / x;
x = ( x + y ) / 2.0;
y = z / x;
x = ( x + y ) / 2.0;
y = z / x;
x = ( x + y ) / 2.0;
y = z / x;
x = ( x + y ) / 2.0;
y = z / x;
x = ( x + y ) / 2.0;
y = z / x;


fprintf ( ' X = %e, Y = %e\n', x, y );
fprintf ( ' X = %f, Y = %g\n', x, y );