Radar van Elk Solutions

Hackaday · Creativity & design

Intel 8087's Trigonometric Function Algorithm Revealed

Reverse-engineering of the Intel 8087 Floating Point Unit (FPU) has uncovered the hybrid algorithm used for its trigonometric functions, specifically FPTAN.

The 8087 employs a hybrid approach combining the CORDIC algorithm with polynomial approximation (Padé approximant) to achieve high accuracy and speed. Initially, CORDIC calculates 16 bits of the result.

The remaining bits are then computed using a ratio of two polynomials. This method is efficient because CORDIC handles the bulk of the calculation, leaving a small remainder for the polynomial approximation.

This hybrid technique avoids the need for extremely large lookup tables and excessive computation time that would be required if CORDIC were used for the entire calculation.

Analysis shows that for FPTAN, CORDIC operations (pseudo-division and multiplication) account for about 80% of the computation, while the polynomial approximation takes about 15%, with 5% overhead.

Later Intel processors, starting with the Pentium series, moved away from CORDIC due to scaling limitations and time penalties for high bit accuracy. The introduction of SIMD instructions further reduced the reliance on x87 ISA functionality.

AI-samenvatting op basis van de bron.

Hackaday