Abstract
In some embodiments, a hardware implemented method for determining a logarithmic functional unit includeses providing a segment number, using the segment number to determine a piecewise linear approximation on a plurality of corresponding intervals for approximating a function for converting a fraction, providing a bit precision, converting endpoints separating the plurality of intervals to corresponding binary endpoints separating an additional plurality of intervals in the bit precision, determining an adjusted piecewise linear approximation that has an approximation error less than a threshold and is on the additional plurality of intervals, encoding coefficients of the adjusted piecewise linear approximation, determining a less precise approximation from the adjusted piecewise linear approximation as a candidate linear approximation, wherein the less precise approximation uses an argument value having a least bit-width while still being able to have an approximation error less than the threshold and implementing the less precise approximation to obtain an implementation circuit.