Stories
Slash Boxes
Comments

SoylentNews is people

SoylentNews is powered by your submissions, so send in your scoop. Only 16 submissions in the queue.
posted by mrcoolbp on Monday September 28, @06:24AM   Printer-friendly

https://www.righto.com/2026/09/8087-tangent-cordic.html

I hope you're not tired of the 8087, because I have another article about Intel's floating-point chip.1 In 1980, Intel introduced the 8087, making floating-point operations much faster in the IBM PC and other systems. In this article, I look at the algorithm behind the chip's tangent instruction. One popular approach for trigonometric functions is an algorithm called CORDIC. Another approach is a polynomial approximation. The 8087 combined the two to obtain both high accuracy and high performance. The 8087 provided an enormous speedup over the 8086 microprocessor, computing a tangent in 90 microseconds rather than 13,000 microseconds.2

By examining the circuitry and microcode of the 8087, I can explain the algorithm behind the tangent instruction, called FPTAN. To explore the 8087's circuitry, I popped the lid off a chip with a chisel and created a high-resolution image with a microscope.


Original Submission

 
This discussion was created by mrcoolbp (68) for logged-in users only, but now has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 4, Informative) by weirsbaski on Monday September 28, @05:33PM (3 children)

    by weirsbaski (4539) on Monday September 28, @05:33PM (#1455081)

    There are no exponential time algorithms. Everything can be solved by lookup tables in constant time!

    That first sentence doesn't follow from the second sentence. Just because lookup tables can be awesomely good doesn't mean that exponential-time algorithms don't also exist.

    (And I'll leave to the reader to decide whether lookup tables might be impractical for the problem anyway, depending on the size of the tables required).

    Starting Score:    1  point
    Moderation   +2  
       Informative=2, Total=2
    Extra 'Informative' Modifier   0  
    Karma-Bonus Modifier   +1  

    Total Score:   4  
  • (Score: 0) by Anonymous Coward on Tuesday September 29, @02:01AM (2 children)

    by Anonymous Coward on Tuesday September 29, @02:01AM (#1455119)

    I haven't thought this through, but I'm wondering if a moderate sized LUT + calculations would be a workable compromise?

    • (Score: 3, Informative) by weirsbaski on Tuesday September 29, @04:36AM

      by weirsbaski (4539) on Tuesday September 29, @04:36AM (#1455130)

      I haven't thought this through, but I'm wondering if a moderate sized LUT + calculations would be a workable compromise?

      I've seen something similar implemented on real silicon in the past (fast approximations for reciprocal and reciprocal-square-root), IIRC they looked up values in two lookup tables in parallel (a "bipartite table"), and added the results together to get the approximation. Don't know how widespread this method is though.

    • (Score: 3, Insightful) by lars_stefan_axelsson on Tuesday September 29, @12:12PM

      by lars_stefan_axelsson (3590) on Tuesday September 29, @12:12PM (#1455143)

      I haven't thought this through, but I'm wondering if a moderate sized LUT + calculations would be a workable compromise?

      Yes, that's whole field in numerical analysis. You can do it a couple of ways but one is to use piecewise polynomials instead of a polynomial of untractable degree: https://www.sciencedirect.com/topics/computer-science/polynomial-approximation [sciencedirect.com].

      You can also start with a lookup and then do interpolation, or even more formal error correction: https://www.ijera.com/special_issue/NLTSETE&S/ECE/ECE-PP-001%20-%200107.pdf [ijera.com]. This paper is even with hardware implementation in mind. LUT plus small polynomial for interpolation exactly like you propose.

      --
      Stefan Axelsson