Title:

Kind
Code:

A1

Abstract:

A processor based system may convert a mathematical function to a power series converging on that function. One or more sets of coefficients for the power series may be pre-computed and stored in machine readable storage medium. In response to a request to execute the mathematical function, the processor obtains coefficients of the terms of the power series from storage and sums up the terms.

Inventors:

Harrison, John R. (Beaverton, OR, US)

Tang, Ping T. (Hayward, CA, US)

Tang, Ping T. (Hayward, CA, US)

Application Number:

10/229448

Publication Date:

03/04/2004

Filing Date:

08/28/2002

Export Citation:

Assignee:

HARRISON JOHN R.

TANG PING T.

TANG PING T.

Primary Class:

International Classes:

View Patent Images:

Related US Applications:

Primary Examiner:

NGO, CHUONG D

Attorney, Agent or Firm:

Timothy N. Trop (HOUSTON, TX, US)

Claims:

1. A method comprising: obtaining from a machine readable storage medium a set of numeric values for coefficients of a power series that converges on a specified mathematical function; calculating a plurality of terms of the power series using the set of numeric values; and returning a sum of the plurality of the terms of the power series for the specified mathematical function.

2. The method of claim 1 further comprising storing in the machine readable storage medium the set of numeric values for coefficients of the power series.

3. The method of claim 1, wherein the specified mathematical function is the tangent function.

4. The method of claim 1, wherein the specified mathematical function is the arcsine function.

5. The method of claim 1, wherein the specified mathematical function is the arccosine function.

6. The method of claim 1, wherein the specified mathematical function is a reconstruction equation for interpolating an answer to a second mathematical function.

7. A method comprising: pre-computing a plurality of sets of coefficients for a power series converging on a reconstruction equation for a specified mathematical function; and storing the plurality of sets of coefficients in a machine readable storage medium.

8. The method of claim 7, wherein the specified mathematical function is the tangent function.

9. A system, comprising: memory for storing sets of coefficients for a plurality of terms of a power series converging on a specified mathematical function; and a processor to sum up the plurality of terms of the power series and return the sum of the terms for the specified mathematical function.

10. The system of claim 9, wherein the specified mathematical function is the tangent function.

11. The system of claim 9 wherein the processor includes a floating point math unit.

12. The system of claim 9 wherein the processor includes at least one arithmetic logic unit.

13. An article including a machine-readable storage medium containing instructions that if executed cause a system to: store a set of coefficients for terms of a power series that converges on a specified mathematical function; and in response to a request to execute the specified mathematical function, retrieve the stored set of coefficients for terms of the power series and sum up the terms using the stored set of coefficients.

14. The article of claim 13 wherein the specified mathematical function is a reconstruction equation for a second mathematical function.

15. The article of claim 13 wherein the specified mathematical function is a reconstruction equation for the tangent function.

16. The article of claim 13 wherein the specified mathematical function is a reconstruction equation for the arcsine function.

17. The article of claim 13 wherein the specified mathematical function is a reconstruction equation for the arccosine function.

18. The article of claim 13 wherein the machine-readable storage medium stores a plurality of sets of coefficients for the terms of the power series.

19. The article of claim 13 wherein the coefficients for the terms of the power series are stored as a lookup table in the machine-readable storage medium.

21. The article of claim 14 wherein coefficients for the terms of a plurality of mathematical functions are stored in the machine-readable storage medium.

Description:

[0001] This invention relates to processor-based systems that perform arithmetic and mathematical operations.

[0002] Modern processor-based systems include processors that execute a variety of arithmetic and other mathematical operations. For example, one or more arithmetic logic units and/or floating point math units in a processor may execute arithmetic and mathematical operations. In many processor-based systems, the speed of arithmetic or mathematical operations may be a bottleneck to performance. To reduce or minimize this bottleneck for arithmetic and mathematical operations, some processor-based systems may store pre-computed values for certain mathematical functions as a lookup table in memory or other machine readable storage medium, and execute a function using a pre-computed value.

[0003] For example, a processor may obtain one or more pre-computed values from a lookup table in memory, and interpolate the answer to a mathematical function from the pre-computed value(s) using a reconstruction equation. For example, a processor may execute the function sin(x) for a floating point number x by accessing a table in memory or other machine readable storage medium to find and select a value A which is close to the variable x. For example, the value r=A−x may be minimized. In the table, each value for A may be evenly spaced at some distance B, so A=nB. For example, B may be n/32 for the sin function. The processor may retrieve values for the functions sin(A) and cos(A) from the table in memory or other machine readable storage medium. The processor may calculate the answer to a reconstruction equation such as: sin(x)=sin(A)+sin(A) [cos(r)−1]+cos(A)sin(r), where r=x−A.

[0004] With breakpoints a distance B apart, |r|≦B/2. If the bound is reasonably small, for example on the order of 2^{−5}

[0005] Accordingly, a processor based system may execute a mathematical function by obtaining one or more pre-computed values from a table in memory, and interpolating the answer with a suitable reconstruction equation.

[0006] The processor time for executing some mathematical functions, however, cannot be reduced substantially or significantly through use of a table and reconstruction equation. For example, some functions and/or reconstruction equations involve division of floating point numbers. One such example is the reconstruction equation for the tangent function. Other examples include the arcsine and arccosine functions. In modern processor based systems, division of floating point numbers takes more processor execution time than multiplication or addition. A need exists for faster execution by processor based systems of some mathematical functions and reconstruction equations on floating point numbers.

[0007]

[0008]

[0009]

[0010] In one embodiment of the invention, a processor based system computes and stores a plurality of different sets of coefficients for polynomials of a power series that converges on a specified mathematical function. A power series is an equation having the general form: a_{0}_{1}_{2}^{2}_{3}^{3}_{4}^{4}_{n }

[0011] The numbers a_{n }_{0}_{1}_{0}_{2}_{0}^{2}_{3}_{0}^{3}_{4}_{0}^{4}_{0}

[0012] One embodiment of the invention includes a processor based system that computes and stores one or more sets of values for the coefficients in the reconstruction equation for a mathematical function such as the tangent function, the arcsine function, or the arccosine function. The reconstruction equations for each of these functions may be converted to a power series. In one embodiment, the reconstruction equation for a mathematical function f(x) may be converted to an equation having the form: f(x)=f(A)+f′(A)r+f″(A)r^{2}

[0013] One embodiment of the invention may be implemented in software for execution by a processor based system configured with a suitable combination of hardware devices. The machine readable storage medium may include, but is not limited to, any type of disk including floppy disks, optical disks, CD-ROMs, CD-RWs, and magneto-optical disks, semiconductor devices such as ROMs, RAMs, EPROMs, EEPROMs, magnetic or optical cards, or any type of media suitable for storing electronic information. Similarly, embodiments may be implemented as software modules executed by a programmable control device. A programmable control device may be a computer processor or a custom designed state machine. Custom designed state machines may be embodied in a hardware device such as a printed circuit board having discrete logic, integrated circuits, or specially designed application specific integrated circuits (ASICs).

[0014] One or more embodiments of the invention may be implemented in hardware or firmware in a processor based system. For example, the invention may be implemented in the hardware or firmware of a processor, and specifically in an arithmetic logic unit of floating point math unit of a processor.

[0015] Referring to

[0016] The memory hub

[0017] In an alternative embodiment, the storage controller

[0018] Additional devices

[0019] Although the description makes reference to specific components of the system

[0020]

[0021] For example, for a mathematical function f, table

[0022] In one embodiment of the invention, a processor based system converts a mathematical function to a power series converging on that function. A plurality of sets of numeric values for coefficients in the power series may be computed and stored in memory or other machine readable storage. Multiple sets of coefficients may be computed and stored for one or more variables in the mathematical function. Thus, in one embodiment of the invention, one or more sets of numeric values for the coefficients in a power series may be computed and stored in memory, with each set corresponding to a numeric value of a variable in a mathematical function.

[0023]

[0024] In block

[0025] In one embodiment of the invention, in block ^{0}^{1}^{2}^{0}^{1}^{2}

[0026] In one embodiment of the invention, each mathematical function stores as a table N different entries for each value of A, and each entry has k different polynomial coefficients. Thus, a table may have Nk polynomial coefficients. One embodiment of the invention contemplates summing up a finite number of terms of the power series, and the overall accuracy of the computation depends on the number of terms summed up, as well as the number of pre-computed values for A.

[0027] In one embodiment of the invention, certain terms in the power series may include the slope σ of the specified mathematical function. The slope σ may be pre-computed and stored for each pre-computed and stored value of variable A. This embodiment may be particularly useful for mathematical functions having a slope σ that is close to a power of 2 at x=0. In other words, |σ|=±2^{α }

^{2}

[0028] In this embodiment, the first two terms, f(A) and σr, constitute the dominant part of the final answer of the above power series, even for small x. At the low end, |(f′(A)−σ)r| is much less than |σr|, while at the high end, f(A) is large enough to dominate the answer. The processor based system may compute σr without rounding error because |σ| is a power of 2, and may determine f(A)+σr accurately by accessing the values for f(A) stored as a lookup table.

[0029] A specific example of one embodiment of the invention is a processor based system for calculating the tangent function tan(x). The tangent function has the following reconstruction equation:

[0030] The reconstruction equation for the tangent function may be converted to the power series:

^{2}

[0031] This power series may be characterized as converging on the reconstruction equation for the tangent function. In this example, tan(A), tan′(A) and tan″(A)/2, etc. define a set of coefficients for each of the possible values of the variable A. One or more sets of these coefficients may be pre-computed and stored as a table.

[0032] Along with the coefficients listed above, the slope σ for each value of A for the reconstruction equation for the tangent function may be stored as a table. Including the slope σ may be useful if the input x is near even multiples of n/2. Thus, the slope a of the tangent function may be pre-computed and stored for each value of A. If so, the following tangent function may be written and executed:

^{2}

[0033] If the input x for the tangent function is near odd multiples of n/2, however, the tangent function may be converted to an equation having the following form: 1/(x−(2n+1)n/2), where n is any integer.

[0034] Embodiments of the present invention may reduce or minimize the time to execute certain arithmetic and mathematical operations, improving the overall performance of a processor based system.

[0035] While the present invention has been described with respect to a limited number of embodiments, those skilled in the art will appreciate numerous modifications and variations therefrom. It is intended that the appended claims cover all such modifications and variations as fall within the true spirit and scope of this present invention.