IQMathLibrary  1.0
_IQNtables.h
1 #ifndef _IQNTABLES_H_
2 #define _IQNTABLES_H_
3 
4 #include <stdint.h>
5 
6 /* LOG lookup and coefficient tables. */
7 #define _IQ30log_order 14
8 extern const uint_fast32_t _IQNlog_min[5];
9 extern const uint_fast32_t _IQ30log_coeffs[15];
10 
11 /* asin and acos coefficient table. */
12 extern const int_fast32_t _IQ29Asin_coeffs[17][5];
13 
14 /* sin and cos lookup tables. */
15 extern const int_fast32_t _IQ31CosLookup[52];
16 extern const int_fast32_t _IQ31SinLookup[52];
17 
18 /* atan coefficient table. */
19 extern const int_fast32_t _IQ32atan_coeffs[132];
20 
21 /* Tables for exp function. Min/Max and integer lookup for each q type */
22 #define _IQ30exp_order 10
23 extern const uint_fast32_t _IQNexp_min[30];
24 extern const uint_fast32_t _IQNexp_max[30];
25 extern const uint_fast16_t _IQNexp_offset[30];
26 extern const uint_fast32_t _IQNexp_lookup1[22];
27 extern const uint_fast32_t _IQNexp_lookup2[22];
28 extern const uint_fast32_t _IQNexp_lookup3[22];
29 extern const uint_fast32_t _IQNexp_lookup4[22];
30 extern const uint_fast32_t _IQNexp_lookup5[22];
31 extern const uint_fast32_t _IQNexp_lookup6[22];
32 extern const uint_fast32_t _IQNexp_lookup7[22];
33 extern const uint_fast32_t _IQNexp_lookup8[22];
34 extern const uint_fast32_t _IQNexp_lookup9[22];
35 extern const uint_fast32_t _IQNexp_lookup10[22];
36 extern const uint_fast32_t _IQNexp_lookup11[22];
37 extern const uint_fast32_t _IQNexp_lookup12[22];
38 extern const uint_fast32_t _IQNexp_lookup13[22];
39 extern const uint_fast32_t _IQNexp_lookup14[22];
40 extern const uint_fast32_t _IQNexp_lookup15[22];
41 extern const uint_fast32_t _IQNexp_lookup16[22];
42 extern const uint_fast32_t _IQNexp_lookup17[22];
43 extern const uint_fast32_t _IQNexp_lookup18[22];
44 extern const uint_fast32_t _IQNexp_lookup19[22];
45 extern const uint_fast32_t _IQNexp_lookup20[22];
46 extern const uint_fast32_t _IQNexp_lookup21[22];
47 extern const uint_fast32_t _IQNexp_lookup22[22];
48 extern const uint_fast32_t _IQNexp_lookup23[22];
49 extern const uint_fast32_t _IQNexp_lookup24[22];
50 extern const uint_fast32_t _IQNexp_lookup25[22];
51 extern const uint_fast32_t _IQNexp_lookup26[22];
52 extern const uint_fast32_t _IQNexp_lookup27[22];
53 extern const uint_fast32_t _IQNexp_lookup28[22];
54 extern const uint_fast32_t _IQNexp_lookup29[22];
55 extern const uint_fast32_t _IQNexp_lookup30[22];
56 extern const uint_fast32_t _IQ30exp_coeffs[11];
57 
58 /*
59  * Q0.15 lookup table for 1/2x best guess.
60  */
61 extern const uint8_t _IQ6div_lookup[65];
62 
63 /*
64  * Q0.15 lookup table for 1/(2*sqrt(x)) best guess.
65  * 96 entries gives us enough accuracy to only need 2 iterations.
66  */
67 extern const uint_fast16_t _IQ14sqrt_lookup[96];
68 
69 /*
70  * Lookup table for shifting using the multiplier.
71  * Right: Index is the shift count, result is high 32 bits.
72  * Left: Index is 32 - count, result is low (and high) 32 bits.
73  */
74 extern const uint_fast32_t _IQNshift32[32];
75 
76 #endif
© Copyright 1995-2025, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale