Intel's 8087 Chip Computed Tangents 144 Times Faster by Blending Two Algorithms
Reverse-engineering the Intel 8087's tangent algorithm: more than CORDIC

The Intel 8087, introduced in 1980, computed a tangent in just 90 microseconds—a 144-fold speedup over the 8086's 13,000 microseconds. Ken Shirriff reverse-engineered the chip's FPTAN instruction by examining its microcode and circuitry. The 8087 combines CORDIC, which handles the first 16 bits of accuracy using only shifts and adds, with a Padé rational approximation for the tiny remaining angle. This hybrid approach achieves 64-bit accuracy without ever performing an explicit division.
The 8087 combined the two to obtain both high accuracy and high performance.
- cmovq
Always thought it was strange that fptan also pushes 1 to the register stack. It now makes sense it’s to retain comparability with the 8087 which returned x and y separately and required the extra division
- drob518
The combination of numerical methods and low-level hardware is fascinating. Those 20th century engineers were both smart and creative.
- kens
Author here for your 8087 questions...