The template parameter TP_DOMAIN_MODE will control the domain of input data that is expected for the particular function’s approximation. Provided input data that is outside the chosen TP_DOMAIN_MODE domain will result in undefined behavior at the output. There are three possible TP_DOMAIN_MODES available:
TP_DOMAIN_MODE | Input domain | Integer input range | Floating-point input range | Notes |
---|---|---|---|---|
0 | 0 <= x < 1 | 0 <= int(x) < 2 ^ (TP_COARSE_BITS + TP_FINE_BITS) | 0 <= float(x) < 1 | Integer and floating-point samples in specified ranges correspond to a normalized input of 0 to 1. Must not be used for functions where f(x) is infinity at x = 0. |
1 | 1 <= x < 2 | 0 <= int(x) < 2 ^ (TP_COARSE_BITS + TP_FINE_BITS - 1) | 0 <= float(x) < 1 | The most significant bit in the TP_COARSE_BITS field of each data input sample must be set to zero. As such, the number of locations in the lookup tables is half that of other TP_DOMAIN_MODES. This applies to floating-point values where float values 0 to 1 will correspond to a domain of 1 to 2 for the function. |
2 | 1 <= x < 4 | 2 ^ (TP_COARSE_BITS + TP_FINE_BITS - 2) <= int(x) < 2 ^ (TP_COARSE_BITS + TP_FINE_BITS) | 1 <= float(x) < 4 | Lookup tables values for the first quadrant of locations are created but are ignored. As such, the latter three quadrants of the lookup tables will cover an input domain of 1 to 4. |