Trigonometric Argument Reduction Using Look-Up Table Segmentation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The imprecision in representing and performing arithmetic operations on large input arguments for trigonometric functions in computers due to finite memory and irrational periods, such as 2π, leads to inaccurate results.
Innovation Solution
A processor method involving a look-up table (LUT) to store a high precision constant like 2/π, allowing controlled precision in multiplying the input argument with retrieved sections to generate accurate trigonometric function outputs by ensuring correct least significant bits and most significant bits of the multiplication result.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If standard floating-point arithmetic is used for argument reduction with large input arguments, then computational speed is maintained, but precision deteriorates due to the irrational nature of 2π and finite memory representation
Solution Approach 1:
The patent segments the constant 2/π into multiple sections and stores them in a look-up table. By retrieving only the necessary sections based on the magnitude of the input argument, the system achieves high precision without requiring the entire constant to be loaded into memory simultaneously, thus resolving the contradiction between precision and memory complexity.
Solution Approach 2:
The patent pre-calculates and stores sections of the constant 2/π in a look-up table before execution. This preliminary action allows the runtime system to simply retrieve pre-computed values rather than performing complex high-precision calculations on the fly, thereby achieving high precision while maintaining computational efficiency and reducing runtime complexity.
2Measurement precision
If more digits of π are used in argument reduction for large input arguments, then precision is improved, but memory usage and computational complexity increase
Solution Approach 1:
The constant 2/π is divided into multiple sections that can be stored in a look-up table. Only the necessary number of sections are retrieved based on the input argument size, allowing the system to provide high precision when needed while using minimal memory for small arguments, thus resolving the contradiction between precision and memory usage.
Solution Approach 2:
The system dynamically determines how many sections of the constant to retrieve from the look-up table based on the magnitude of the input argument. For smaller arguments, fewer sections are used, reducing memory access and computational overhead. For larger arguments requiring higher precision, more sections are retrieved. This dynamic adaptation resolves the contradiction between precision requirements and memory consumption.
Data Source
AI summary
A method and apparatus for additive range reduction are disclosed. A constant may be pre-stored in a look-up table (LUT), and at least one section of the constant may be retrieved from the LUT for generating a product of an input argument and the constant such that a precision of the product may be controlled in any granularity. For a trigonometric function, 2/π is stored in the LUT, and at least one section of 2/π may be retrieved from the LUT. The argument is multiplied with the retrieved sections of 2/π. The retrieved sections are determined to correctly generate the two least significant bits (LSBs) of an integer portion and a scalable number of most significant bits of the multiplication result. An output of the trigonometric function is generated for the argument with a fractional portion of the multiplication result based on two LSBs of the integer portion of the multiplication result.


