I have tried to implement the CORDIC algorithm to compute the cosine, but the interval of angles for which it works is quite limited.
The picture below has been generated by running this C code on the angles in the $[-2.4, 2.4]$ range:
float cordic_cos_float(float theta){
float x = 0.60725293; // cosine product
float y = 0;
float z = 0;
for (int i = 0; i < 10; i++){
float d = (z > theta) ? 1 : -1; // "binary search" direction
float x_temp = x;
float pseudotan = powf(2, -i); // tangent approx
x = x - y * d * pseudotan;
y = y + x_temp * d * pseudotan;
z = z - d * my_atan(pseudotan); // compensates tangent approx
}
return x;
}
The implementation of my_atan is irrelevant, since even without compensating for the tangent approximation, the interval in which the algorithm works is exactly the same.
The function appears to return $-0.169712$ on any angle below $-1.739400$ or above $1.739400$.
Among the things I have tried, which did not work, were:
- Using double point precision
- Increasing the number of steps from 10 to 40
Does anybody have an idea of why this happens?

I've understood why, it was quite simple actually. Since the step size halves at each iteration, it converges to some angle, and the angle happens to be $\approx \pm 1.739400$, based on the search direction.
It took me some python visualization to get it, so I'll share it with you:
The white lines are the attempt vectors, the (barely visible) green line is the goal vector.