Patent ID: 9600236
Date: 2017-03-21
CPC Classifications: G06F

Claim:
1. An apparatus for computing mathematical functions, the apparatus comprising: a first hardware pipeline configured to receive an argument x and an opcode and perform a polynomial approximation of second degree or higher, the first hardware pipeline including a plurality of stages; and a plurality of data tables, each associated with at least one of LOG (logarithm), COS (cosine), DIV (division), and SIN (sine) functions and configured to be coupled to the first hardware pipeline according to the at least one opcode, wherein each of the plurality of data tables includes data associated with implementing the associated function, the first hardware pipeline being configured to calculate a value A(x) by performing the polynomial approximation using data from the data tables of the plurality of data tables corresponding to the opcode and x; a second hardware pipeline configured to calculate an adjustment factor B(x) corresponding to the opcode; and wherein the first hardware pipeline further configured to calculate an output value as B(x)*A(x); the second hardware pipeline is configured to output a factional portion of x (FracX) when the opcode indicates one of the COS function and the SIN function, wherein B(x) is a function of FracX; and the first hardware pipeline and the plurality of data tables are configured such that the polynomial approximation using data from the data tables is effective to approximate A(x) as ((−1)^IntX)*Sin(pi*Min(FracX, 1.0−FracX))/Min(FracX, 1.0−FracX), where IntX is an integer portion of x, when the opcode indicates the SIN function and Sin(pi*(FracX+0.5)) when the opcode indicates the COS function.