How Do Calculators Calculate?

cordic:=
	(x[k_]:=x[k]=x[k-1]-m δ[k-1]y[k-1](2^(-(k-1)));
y[k_]:=y[k]=y[k-1]+    δ[k-1]x[k-1](2^(-(k-1)));
z[k_]:=z[k]=z[k-1]-     δ[k-1]ϵ[k-1];)
Sgn[t_]:=If[t>=0,1,-1];

For multiplication of the numbers x[0] and [z[0] the initialization is as follows:

m=0;
δ[k_]:=Sgn[z[k]];
ϵ[k_]:=(2^(-k));

Clear[x,y,z];
x[0]=.75123;
		y[0]=0;
		z[0]=-.417;
cordic;
TableForm[Evaluate[Table[{k,x[k],N[y[k],12],z[k]},{k,0,50,5}]],
	TableHeadings->{None,{"k","x[k]","y[k]","z[k]"}}]

For the quotient y[0]/x[0],  the initialization is as follows:

m=0;
δ[k_]:=-Sgn[y[k]];
ϵ[k_]:=(2^(-k));

Clear[x,y,z];
x[0]=9.;
		y[0]=-2.;
		z[0]=0.;
cordic;
TableForm[Evaluate[Table[{k,x[k],N[y[k],12],N[z[k],12]},{k,0,50,5}]],
	TableHeadings->{None,{"k","x[k]","y[k]","z[k]"}}]

To compute sin and cos of a given angle z[0]= θ, initialize as follows:

m=1;
δ[k_]:=Sgn[z[k]];
ϵ[k_]:=N[ArcTan[(2^(-k))]];

Clear[x,y,z];
x[0]=NProduct[Cos[ϵ[p]],{p,0,49}];
		y[0]=0;
		z[0]=N[π/6];
cordic;
TableForm[Evaluate[Table[{k,N[x[k],12],N[y[k],12],N[z[k],12]},{k,0,50,5}]],
	TableHeadings->{None,{"k","x[k]","y[k]","z[k]"}}]

Show[Graphics[
		{Table[{{AbsolutePointSize[6],Point[{x[k],y[k]}]},{Red,Text[k,{x[k],y[k]},{-2.5,0}]}},{k,0,6}],Line[{{0,0},1.2{Cos[z[0]],Sin[z[0]]}}],
			Circle[{0,0},.4,{0,z[0]}],
			Text[θ,{.35,.1}],
			{Dashing[{0.03,0.03}],
				Line[{{Cos[z[0]],0},{Cos[z[0]],Sin[z[0]]}}],
		Line[{{0,Sin[z[0]]},{Cos[z[0]],Sin[z[0]]}}]}}],
				Axes->True,AxesLabel->{x,y},PlotRange->All]

To compute the arctan of the given quotient  y[0]/x[0], initialize as follows:

m=1;
δ[k_]:=-Sgn[y[k]];
ϵ[k_]:=N[ArcTan[(2^(-k))]];

Clear[x,y,z];
x[0]=1.;
		y[0]=1.;
		z[0]=0.;
cordic;
TableForm[Evaluate[Table[{k,N[x[k],12],N[y[k],12],N[z[k],12]},{k,0,50,5}]],
	TableHeadings->{None,{"k","x[k]","y[k]","z[k]"}}]

N[π/4,12]