Reverse-engineering the vintage Intel 8087’s tangent algorithm: more than CORDIC
Intel’s 8087 floating-point coprocessor combined CORDIC with a rational approximation to compute tangent quickly and accurately using the hardware available in 1980. Ken Shirriff reconstructs the FPTAN path from the chip’s die and microcode: the design uses shifts and adds for most of the work, then returns a numerator and denominator rather than spending cycles on division.
The post also explains a useful design trade-off: 16 CORDIC iterations provide most of the precision, while a Padé approximation handles the small residual angle. Lobsters readers praised the reverse-engineering and connected it to software x87 transcendental implementations; one commenter cautioned that x87’s practical accuracy limits matter more than the algorithm alone.