ArcSine and ArcTangent

Computation of Arc Tangent

In order to compute A = ArcTangent(Y) the vector (1, Y) is first drawn. The angle formed by this vector and the horizontal is the value sought-after. To measure this angle, the vector undergoes a series of "pseudoRotations" to pull it down to the horizontal, and the angles arctg (2-j ) of all the "pseudoRotations" are accumulated into A (the constant k is not used here).

Sine, Cosine and Arc Tangent

Turning the applet computing the sine and cosine upside-down compute the arc tangent. The "Nb. bits" selects simultaneously the number of bits of the calculations and the number of steps. Clicking the vertical arrow "view" changes the presentation. The key "Reset" allows to control 'manually' the convergence.

Computation of Arc Sine

In order to compute A = ArcSine(S) the horizontal vector (k, 0) is first drawn. Then the vector undergoes a series of "pseudoRotations" to pull it to the length 1 and its ordinate Y to S. The angles arctg (2-j ) of the "pseudoRotations" are accumulated to yield the sought-after angle A. This algorithm returns a poor result. Actually the vector is not long enough (its length grows from k to 1) for its end to be on the circle. Consequently the comparison of its ordinate Y with S is sometimes incorrect. Check with S slightly larger than k (around 0,60725).
For each iteration, the vector length is multiplied by Ö1+2-2j, multiplying S by the same constant for each iteration would make the comparisons pertinent.
The "double rotation" makes this multiplication less unpleasant since the multiplication by the square of this constant is merely an addition.
X0 = 1 ; Y0 = 0 ; A0 = 0 ; S0 = S ;
if Yj > Sj then

Xj+1 = Xj + 2 * Yj * 2-j Xj * 2-2j ;
Yj+1 = Yj 2 * Xj * 2-j Yj * 2-2j ;
Aj+1 = Aj 2 * arctg(2-i ) ;
Sj+1 = Sj + Sj * 2-2j ;


Xj+1 = Xj 2 * Yj * 2-j Xj * 2-2j ;
Yj+1 = Yj + 2 * Xj * 2-j Yj * 2-2j ;
Aj+1 = Aj + 2 * arctg(2-i ) ;
Sj+1 = Sj + Sj * 2-2j ;

For every iterations (that yields one more bit) this algorithm demands four additions/subtractions for the double rotation, plus one addition/subtraction to accumulate the angles arctg(2-i ) and finally one addition to multiply S by the constant 1 + 2 -2j.

Bipartite Table


The values of a function can be precomputed and stored into a table (a ROM). Nevertheless, the table size grows very quickly with the precision. This practically limits this approach. For continuous functions with small gradient, one may store only a few values in a table named "TIV", and the function gradient, in order to interpolate within the stored points, in another table named "TO".

The following applet fills the tables and plots graphically the result.

In order to add a function, one must modify the source code.

The function arcsin(x) is a counter-example since the gradient variation is large when x is around 1.

A refinement of the method is the multipartite table.