00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include <stdio.h>
00018 #include <math.h>
00019 #include "Fxp.h"
00020
00023
00029 #define TABLE_SIZE 2048
00030
00031 #define ACOS_TEST(x) FXP_Acos(FXP_Cos(x))
00032 #define ASIN_TEST(x) FXP_Asin(FXP_Sin(x))
00033 #define ATAN_TEST(x) FXP_Atan(FXP_Tan(x))
00034
00036 #define TABLEPOS_TO_ANGLE(n) ((Afxp)((AFXP_MAX*n)/TABLE_SIZE))
00037
00038 #define ANGLE_TO_TABLEPOS(a) (((TABLE_SIZE*(int)a)/AFXP_MAX)%TABLE_SIZE)
00039
00040 #define AVERAGE(x,y) ((x+y)/2)
00041
00043 extern const Sfxp __SIN_TABLE[];
00045 extern const Sfxp __COS_TABLE[];
00047 extern const Sfxp __TAN_TABLE[];
00048
00050 int FindInTable(Sfxp val, int min, int max, const Sfxp table[TABLE_SIZE]);
00051
00053 int FXP_DumpTrig(const char *fname)
00054 {
00055 int n=-1;
00056 FILE *fp=fopen(fname,"w");
00057 if(fp==NULL) return(-1);
00058
00059 fprintf(fp,"/* Put this portion in the .h file */\n");
00060 fprintf(fp,"extern Sfxp __SIN_TABLE[];\n");
00061 fprintf(fp,"extern Sfxp __COS_TABLE[];\n");
00062 fprintf(fp,"extern Sfxp __TAN_TABLE[];\n\n");
00063
00064 fprintf(fp,"/* Put this portion in the .c file */\n");
00065 fprintf(fp,"Sfxp __SIN_TABLE[%d] = {\n",TABLE_SIZE);
00066 for(n=0; n<TABLE_SIZE; n++)
00067 {
00068 if(n==(TABLE_SIZE-1)) fprintf(fp,"%5d\n",__SIN_TABLE[n]);
00069 else fprintf(fp,"%5d, ",__SIN_TABLE[n]);
00070 if((((n+1)%10)==0)&&(n!=0)) fprintf(fp,"\n");
00071 }
00072 fprintf(fp,"};\n");
00073
00074 fprintf(fp,"Sfxp __COS_TABLE[%d] = {\n",TABLE_SIZE);
00075 for(n=0; n<TABLE_SIZE; n++)
00076 {
00077 if(n==(TABLE_SIZE-1)) fprintf(fp,"%5d\n",__COS_TABLE[n]);
00078 else fprintf(fp,"%5d, ",__COS_TABLE[n]);
00079 if((((n+1)%10)==0)&&(n!=0)) fprintf(fp,"\n");
00080 }
00081 fprintf(fp,"};\n");
00082
00083
00084 fprintf(fp,"Sfxp __TAN_TABLE[%d] = {\n",TABLE_SIZE);
00085 for(n=0; n<TABLE_SIZE; n++)
00086 {
00087 if(n==(TABLE_SIZE-1)) fprintf(fp,"%10d\n",__TAN_TABLE[n]);
00088 else fprintf(fp,"%10d, ",__TAN_TABLE[n]);
00089 if((((n+1)%5)==0)&&(n!=0)) fprintf(fp,"\n");
00090 }
00091 fprintf(fp,"};\n");
00092
00093
00094 return(0);
00095 }
00096
00098 void FXP_Init()
00099 {
00100 int n=-1;
00101
00102 #if 0
00103 for(n=0; n<TABLE_SIZE; n++)
00104 {
00105 Angle a(TABLEPOS_TO_ANGLE(n));
00106 double rad=a.Radians();
00107
00108 __SIN_TABLE[n]=F_TO_SFXP(sin(rad));
00109 __COS_TABLE[n]=F_TO_SFXP(cos(rad));
00110 __TAN_TABLE[n]=F_TO_SFXP(tan(rad));
00111 }
00112 #endif
00113
00114
00115 FXP_DumpTrig("trig.txt");
00116 }
00117
00118 Afxp FXP_Asin(Sfxp val)
00119 {
00120 int index=-1;
00121
00122 if(val==0)
00123 {
00124 return(0);
00125 }
00126 else if(val>0)
00127 {
00128
00129 if(val==TO_SFXP(1))
00130 {
00131 return(AFXP_MAX/4);
00132 }
00133 else
00134 {
00135 index=FindInTable(val,0,(TABLE_SIZE/4)+1,__SIN_TABLE);
00136 }
00137 }
00138 else
00139 {
00140
00141 if(val==TO_SFXP(-1))
00142 {
00143 return((AFXP_MAX*3)/4);
00144 }
00145 else
00146 {
00147 index=FindInTable(val,(TABLE_SIZE*3)/4,TABLE_SIZE-1,__SIN_TABLE);
00148 index-=((TABLE_SIZE*3)/4);
00149 index=((TABLE_SIZE*3)/4)-index;
00150 }
00151 }
00152
00153 return(TABLEPOS_TO_ANGLE(index));
00154 }
00155
00156 Afxp FXP_Acos(Sfxp val)
00157 {
00158 int index=-1;
00159
00160
00161
00162 if(val==TO_SFXP(0))
00163 {
00164 return(AFXP_MAX/4);
00165 }
00166 else if(val>0)
00167 {
00168
00169 if(val==TO_SFXP(1))
00170 {
00171 return(0);
00172 }
00173 else
00174 {
00175 index=FindInTable(val,(TABLE_SIZE*3)/4,TABLE_SIZE-1,__COS_TABLE);
00176 index-=(TABLE_SIZE*3)/4;
00177 index=(TABLE_SIZE/4)-index;
00178 }
00179 }
00180 else
00181 {
00182 index=FindInTable(val,TABLE_SIZE/2,(TABLE_SIZE*3)/4+1,__COS_TABLE);
00183 index-=TABLE_SIZE/2;
00184 index=(TABLE_SIZE/2)-index;
00185 }
00186
00187 return(TABLEPOS_TO_ANGLE(index));
00188 }
00189
00190 Afxp FXP_Atan(Sfxp val)
00191 {
00192 int index=-1;
00193
00194
00195 if(val==0)
00196 {
00197 return(0);
00198 }
00199 else if(val>0)
00200 {
00201 index=FindInTable(val,0,(TABLE_SIZE/4)+1,__TAN_TABLE);
00202 }
00203 else
00204 {
00205 index=FindInTable(val,(TABLE_SIZE/4),(TABLE_SIZE/2)+1,__TAN_TABLE);
00206 }
00207
00208 return(TABLEPOS_TO_ANGLE(index)%DEG_TO_AFXP(90));
00209 }
00210
00211 Sfxp FXP_Sin(Afxp a)
00212 {
00213 return(__SIN_TABLE[ANGLE_TO_TABLEPOS(a)]);
00214 }
00215
00216 Sfxp FXP_Cos(Afxp a)
00217 {
00218 return(__COS_TABLE[ANGLE_TO_TABLEPOS(a)]);
00219 }
00220
00221 Sfxp FXP_Tan(Afxp a)
00222 {
00223 return(__TAN_TABLE[ANGLE_TO_TABLEPOS(a)]);
00224 }
00225
00226 int FindInTable(Sfxp val, int min, int max, const Sfxp table[TABLE_SIZE])
00227 {
00228 while(min!=max)
00229 {
00230 int pos=AVERAGE(min,max);
00231 int fval=table[pos];
00232
00233 if(min+1==max)
00234 {
00235 return(pos);
00236 }
00237 else if(fval<val)
00238 {
00239 min=pos;
00240 }
00241 else if(fval>val)
00242 {
00243 max=pos;
00244 }
00245 else
00246 {
00247 return(pos);
00248 }
00249 }
00250
00251 return(min);
00252 }
00253
00258 Afxp FXP_Traj(Sfxp y, Sfxp x)
00259 {
00260 Afxp a=0;
00261
00262 if((x!=0)&&(y!=0))
00263 {
00264 a=FXP_Atan(DIV_SFXP(y,x));
00265 if(x>0)
00266 {
00267 if(y<0)
00268 {
00269 a+=DEG_TO_AFXP(270);
00270 }
00271 }
00272 else if(x<0)
00273 {
00274 if(y>0)
00275 {
00276 a+=DEG_TO_AFXP(90);
00277 }
00278 else if(y<0)
00279 {
00280 a+=DEG_TO_AFXP(180);
00281 }
00282 }
00283
00284 }
00285 else if(y!=0)
00286 {
00287 if(y>0) a=DEG_TO_AFXP(90);
00288 else if(y<0) a=DEG_TO_AFXP(270);
00289 }
00290 else if(x!=0)
00291 {
00292 if(x<0) a=DEG_TO_AFXP(180);
00293 else if(x>0) a=DEG_TO_AFXP(0);
00294 }
00295
00296 return(a);
00297 }
00298
00299
00300 const Sfxp __SIN_TABLE[TABLE_SIZE] = {
00301 0, 3, 6, 9, 12, 15, 18, 21, 25, 28,
00302 31, 34, 37, 40, 43, 47, 50, 53, 56, 59,
00303 62, 65, 69, 72, 75, 78, 81, 84, 87, 90,
00304 94, 97, 100, 103, 106, 109, 112, 115, 119, 122,
00305 125, 128, 131, 134, 137, 140, 144, 147, 150, 153,
00306 156, 159, 162, 165, 168, 171, 175, 178, 181, 184,
00307 187, 190, 193, 196, 199, 202, 205, 209, 212, 215,
00308 218, 221, 224, 227, 230, 233, 236, 239, 242, 245,
00309 248, 251, 254, 257, 260, 264, 267, 270, 273, 276,
00310 279, 282, 285, 288, 291, 294, 297, 300, 303, 306,
00311 309, 312, 315, 318, 321, 324, 327, 330, 333, 336,
00312 339, 342, 344, 347, 350, 353, 356, 359, 362, 365,
00313 368, 371, 374, 377, 380, 383, 386, 388, 391, 394,
00314 397, 400, 403, 406, 409, 412, 414, 417, 420, 423,
00315 426, 429, 432, 434, 437, 440, 443, 446, 449, 451,
00316 454, 457, 460, 463, 466, 468, 471, 474, 477, 479,
00317 482, 485, 488, 491, 493, 496, 499, 501, 504, 507,
00318 510, 512, 515, 518, 521, 523, 526, 529, 531, 534,
00319 537, 539, 542, 545, 547, 550, 553, 555, 558, 561,
00320 563, 566, 568, 571, 574, 576, 579, 581, 584, 587,
00321 589, 592, 594, 597, 599, 602, 604, 607, 609, 612,
00322 615, 617, 620, 622, 625, 627, 629, 632, 634, 637,
00323 639, 642, 644, 647, 649, 652, 654, 656, 659, 661,
00324 664, 666, 668, 671, 673, 675, 678, 680, 683, 685,
00325 687, 690, 692, 694, 696, 699, 701, 703, 706, 708,
00326 710, 712, 715, 717, 719, 721, 724, 726, 728, 730,
00327 732, 735, 737, 739, 741, 743, 745, 748, 750, 752,
00328 754, 756, 758, 760, 762, 765, 767, 769, 771, 773,
00329 775, 777, 779, 781, 783, 785, 787, 789, 791, 793,
00330 795, 797, 799, 801, 803, 805, 807, 809, 811, 813,
00331 814, 816, 818, 820, 822, 824, 826, 828, 829, 831,
00332 833, 835, 837, 839, 840, 842, 844, 846, 847, 849,
00333 851, 853, 854, 856, 858, 860, 861, 863, 865, 866,
00334 868, 870, 871, 873, 875, 876, 878, 879, 881, 883,
00335 884, 886, 887, 889, 890, 892, 894, 895, 897, 898,
00336 900, 901, 903, 904, 906, 907, 908, 910, 911, 913,
00337 914, 916, 917, 918, 920, 921, 922, 924, 925, 927,
00338 928, 929, 930, 932, 933, 934, 936, 937, 938, 939,
00339 941, 942, 943, 944, 946, 947, 948, 949, 950, 951,
00340 953, 954, 955, 956, 957, 958, 959, 960, 962, 963,
00341 964, 965, 966, 967, 968, 969, 970, 971, 972, 973,
00342 974, 975, 976, 977, 978, 978, 979, 980, 981, 982,
00343 983, 984, 985, 986, 986, 987, 988, 989, 990, 990,
00344 991, 992, 993, 994, 994, 995, 996, 997, 997, 998,
00345 999, 999, 1000, 1001, 1001, 1002, 1003, 1003, 1004, 1004,
00346 1005, 1006, 1006, 1007, 1007, 1008, 1008, 1009, 1009, 1010,
00347 1010, 1011, 1011, 1012, 1012, 1013, 1013, 1014, 1014, 1015,
00348 1015, 1015, 1016, 1016, 1017, 1017, 1017, 1018, 1018, 1018,
00349 1019, 1019, 1019, 1019, 1020, 1020, 1020, 1020, 1021, 1021,
00350 1021, 1021, 1022, 1022, 1022, 1022, 1022, 1022, 1023, 1023,
00351 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023,
00352 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023,
00353 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1022, 1022, 1022,
00354 1022, 1022, 1022, 1021, 1021, 1021, 1021, 1020, 1020, 1020,
00355 1020, 1019, 1019, 1019, 1019, 1018, 1018, 1018, 1017, 1017,
00356 1017, 1016, 1016, 1015, 1015, 1015, 1014, 1014, 1013, 1013,
00357 1012, 1012, 1011, 1011, 1010, 1010, 1009, 1009, 1008, 1008,
00358 1007, 1007, 1006, 1006, 1005, 1004, 1004, 1003, 1003, 1002,
00359 1001, 1001, 1000, 999, 999, 998, 997, 997, 996, 995,
00360 994, 994, 993, 992, 991, 990, 990, 989, 988, 987,
00361 986, 986, 985, 984, 983, 982, 981, 980, 979, 978,
00362 978, 977, 976, 975, 974, 973, 972, 971, 970, 969,
00363 968, 967, 966, 965, 964, 963, 962, 960, 959, 958,
00364 957, 956, 955, 954, 953, 951, 950, 949, 948, 947,
00365 946, 944, 943, 942, 941, 939, 938, 937, 936, 934,
00366 933, 932, 930, 929, 928, 927, 925, 924, 922, 921,
00367 920, 918, 917, 916, 914, 913, 911, 910, 908, 907,
00368 906, 904, 903, 901, 900, 898, 897, 895, 894, 892,
00369 890, 889, 887, 886, 884, 883, 881, 879, 878, 876,
00370 875, 873, 871, 870, 868, 866, 865, 863, 861, 860,
00371 858, 856, 854, 853, 851, 849, 847, 846, 844, 842,
00372 840, 839, 837, 835, 833, 831, 829, 828, 826, 824,
00373 822, 820, 818, 816, 814, 813, 811, 809, 807, 805,
00374 803, 801, 799, 797, 795, 793, 791, 789, 787, 785,
00375 783, 781, 779, 777, 775, 773, 771, 769, 767, 765,
00376 762, 760, 758, 756, 754, 752, 750, 748, 745, 743,
00377 741, 739, 737, 735, 732, 730, 728, 726, 724, 721,
00378 719, 717, 715, 712, 710, 708, 706, 703, 701, 699,
00379 696, 694, 692, 690, 687, 685, 683, 680, 678, 675,
00380 673, 671, 668, 666, 664, 661, 659, 656, 654, 652,
00381 649, 647, 644, 642, 639, 637, 634, 632, 629, 627,
00382 625, 622, 620, 617, 615, 612, 609, 607, 604, 602,
00383 599, 597, 594, 592, 589, 587, 584, 581, 579, 576,
00384 574, 571, 568, 566, 563, 561, 558, 555, 553, 550,
00385 547, 545, 542, 539, 537, 534, 531, 529, 526, 523,
00386 521, 518, 515, 512, 510, 507, 504, 501, 499, 496,
00387 493, 491, 488, 485, 482, 479, 477, 474, 471, 468,
00388 466, 463, 460, 457, 454, 451, 449, 446, 443, 440,
00389 437, 434, 432, 429, 426, 423, 420, 417, 414, 412,
00390 409, 406, 403, 400, 397, 394, 391, 388, 386, 383,
00391 380, 377, 374, 371, 368, 365, 362, 359, 356, 353,
00392 350, 347, 344, 342, 339, 336, 333, 330, 327, 324,
00393 321, 318, 315, 312, 309, 306, 303, 300, 297, 294,
00394 291, 288, 285, 282, 279, 276, 273, 270, 267, 264,
00395 260, 257, 254, 251, 248, 245, 242, 239, 236, 233,
00396 230, 227, 224, 221, 218, 215, 212, 209, 205, 202,
00397 199, 196, 193, 190, 187, 184, 181, 178, 175, 171,
00398
00399 168, 165, 162, 159, 156, 153, 150, 147, 144, 140,
00400 137, 134, 131, 128, 125, 122, 119, 115, 112, 109,
00401 106, 103, 100, 97, 94, 90, 87, 84, 81, 78,
00402 75, 72, 69, 65, 62, 59, 56, 53, 50, 47,
00403 43, 40, 37, 34, 31, 28, 25, 21, 18, 15,
00404 12, 9, 6, 3, 0, -3, -6, -9, -12, -15,
00405 -18, -21, -25, -28, -31, -34, -37, -40, -43, -47,
00406 -50, -53, -56, -59, -62, -65, -69, -72, -75, -78,
00407 -81, -84, -87, -90, -94, -97, -100, -103, -106, -109,
00408 -112, -115, -119, -122, -125, -128, -131, -134, -137, -140,
00409 -144, -147, -150, -153, -156, -159, -162, -165, -168, -171,
00410 -175, -178, -181, -184, -187, -190, -193, -196, -199, -202,
00411 -205, -209, -212, -215, -218, -221, -224, -227, -230, -233,
00412 -236, -239, -242, -245, -248, -251, -254, -257, -260, -264,
00413 -267, -270, -273, -276, -279, -282, -285, -288, -291, -294,
00414 -297, -300, -303, -306, -309, -312, -315, -318, -321, -324,
00415 -327, -330, -333, -336, -339, -342, -344, -347, -350, -353,
00416 -356, -359, -362, -365, -368, -371, -374, -377, -380, -383,
00417 -386, -388, -391, -394, -397, -400, -403, -406, -409, -412,
00418 -414, -417, -420, -423, -426, -429, -432, -434, -437, -440,
00419 -443, -446, -449, -451, -454, -457, -460, -463, -466, -468,
00420 -471, -474, -477, -479, -482, -485, -488, -490, -493, -496,
00421 -499, -501, -504, -507, -510, -512, -515, -518, -521, -523,
00422 -526, -529, -531, -534, -537, -539, -542, -545, -547, -550,
00423 -553, -555, -558, -561, -563, -566, -568, -571, -574, -576,
00424 -579, -581, -584, -587, -589, -592, -594, -597, -599, -602,
00425 -604, -607, -609, -612, -615, -617, -620, -622, -625, -627,
00426 -629, -632, -634, -637, -639, -642, -644, -647, -649, -652,
00427 -654, -656, -659, -661, -664, -666, -668, -671, -673, -675,
00428 -678, -680, -683, -685, -687, -689, -692, -694, -696, -699,
00429 -701, -703, -706, -708, -710, -712, -715, -717, -719, -721,
00430 -724, -726, -728, -730, -732, -735, -737, -739, -741, -743,
00431 -745, -748, -750, -752, -754, -756, -758, -760, -762, -765,
00432 -767, -769, -771, -773, -775, -777, -779, -781, -783, -785,
00433 -787, -789, -791, -793, -795, -797, -799, -801, -803, -805,
00434 -807, -809, -811, -813, -814, -816, -818, -820, -822, -824,
00435 -826, -828, -829, -831, -833, -835, -837, -839, -840, -842,
00436 -844, -846, -847, -849, -851, -853, -854, -856, -858, -860,
00437 -861, -863, -865, -866, -868, -870, -871, -873, -875, -876,
00438 -878, -879, -881, -883, -884, -886, -887, -889, -890, -892,
00439 -894, -895, -897, -898, -900, -901, -903, -904, -906, -907,
00440 -908, -910, -911, -913, -914, -916, -917, -918, -920, -921,
00441 -922, -924, -925, -927, -928, -929, -930, -932, -933, -934,
00442 -936, -937, -938, -939, -941, -942, -943, -944, -946, -947,
00443 -948, -949, -950, -951, -953, -954, -955, -956, -957, -958,
00444 -959, -960, -962, -963, -964, -965, -966, -967, -968, -969,
00445 -970, -971, -972, -973, -974, -975, -976, -977, -978, -978,
00446 -979, -980, -981, -982, -983, -984, -985, -986, -986, -987,
00447 -988, -989, -990, -990, -991, -992, -993, -994, -994, -995,
00448 -996, -997, -997, -998, -999, -999, -1000, -1001, -1001, -1002,
00449 -1003, -1003, -1004, -1004, -1005, -1006, -1006, -1007, -1007, -1008,
00450 -1008, -1009, -1009, -1010, -1010, -1011, -1011, -1012, -1012, -1013,
00451 -1013, -1014, -1014, -1015, -1015, -1015, -1016, -1016, -1017, -1017,
00452 -1017, -1018, -1018, -1018, -1019, -1019, -1019, -1019, -1020, -1020,
00453 -1020, -1020, -1021, -1021, -1021, -1021, -1022, -1022, -1022, -1022,
00454 -1022, -1022, -1023, -1023, -1023, -1023, -1023, -1023, -1023, -1023,
00455 -1023, -1023, -1023, -1023, -1023, -1023, -1023, -1023, -1023, -1023,
00456 -1023, -1023, -1023, -1023, -1023, -1023, -1023, -1023, -1023, -1023,
00457 -1023, -1022, -1022, -1022, -1022, -1022, -1022, -1021, -1021, -1021,
00458 -1021, -1020, -1020, -1020, -1020, -1019, -1019, -1019, -1019, -1018,
00459 -1018, -1018, -1017, -1017, -1017, -1016, -1016, -1015, -1015, -1015,
00460 -1014, -1014, -1013, -1013, -1012, -1012, -1011, -1011, -1010, -1010,
00461 -1009, -1009, -1008, -1008, -1007, -1007, -1006, -1006, -1005, -1004,
00462 -1004, -1003, -1003, -1002, -1001, -1001, -1000, -999, -999, -998,
00463 -997, -997, -996, -995, -994, -994, -993, -992, -991, -990,
00464 -990, -989, -988, -987, -986, -986, -985, -984, -983, -982,
00465 -981, -980, -979, -978, -978, -977, -976, -975, -974, -973,
00466 -972, -971, -970, -969, -968, -967, -966, -965, -964, -963,
00467 -962, -960, -959, -958, -957, -956, -955, -954, -953, -951,
00468 -950, -949, -948, -947, -946, -944, -943, -942, -941, -939,
00469 -938, -937, -936, -934, -933, -932, -930, -929, -928, -927,
00470 -925, -924, -922, -921, -920, -918, -917, -916, -914, -913,
00471 -911, -910, -908, -907, -906, -904, -903, -901, -900, -898,
00472 -897, -895, -894, -892, -890, -889, -887, -886, -884, -883,
00473 -881, -879, -878, -876, -875, -873, -871, -870, -868, -866,
00474 -865, -863, -861, -860, -858, -856, -854, -853, -851, -849,
00475 -847, -846, -844, -842, -840, -839, -837, -835, -833, -831,
00476 -829, -828, -826, -824, -822, -820, -818, -816, -814, -813,
00477 -811, -809, -807, -805, -803, -801, -799, -797, -795, -793,
00478 -791, -789, -787, -785, -783, -781, -779, -777, -775, -773,
00479 -771, -769, -767, -765, -762, -760, -758, -756, -754, -752,
00480 -750, -748, -745, -743, -741, -739, -737, -735, -732, -730,
00481 -728, -726, -724, -721, -719, -717, -715, -712, -710, -708,
00482 -706, -703, -701, -699, -696, -694, -692, -690, -687, -685,
00483 -683, -680, -678, -675, -673, -671, -668, -666, -664, -661,
00484 -659, -656, -654, -652, -649, -647, -644, -642, -639, -637,
00485 -634, -632, -630, -627, -625, -622, -620, -617, -615, -612,
00486 -609, -607, -604, -602, -599, -597, -594, -592, -589, -587,
00487 -584, -581, -579, -576, -574, -571, -568, -566, -563, -561,
00488 -558, -555, -553, -550, -547, -545, -542, -539, -537, -534,
00489 -531, -529, -526, -523, -521, -518, -515, -512, -510, -507,
00490 -504, -501, -499, -496, -493, -491, -488, -485, -482, -479,
00491 -477, -474, -471, -468, -466, -463, -460, -457, -454, -451,
00492 -449, -446, -443, -440, -437, -434, -432, -429, -426, -423,
00493 -420, -417, -414, -412, -409, -406, -403, -400, -397, -394,
00494 -391, -388, -386, -383, -380, -377, -374, -371, -368, -365,
00495 -362, -359, -356, -353, -350, -347, -344, -342, -339, -336,
00496 -333, -330, -327, -324, -321, -318, -315, -312, -309, -306,
00497 -303, -300, -297, -294, -291, -288, -285, -282, -279, -276,
00498 -273, -270, -267, -264, -260, -257, -254, -251, -248, -245,
00499 -242, -239, -236, -233, -230, -227, -224, -221, -218, -215,
00500 -212, -209, -205, -202, -199, -196, -193, -190, -187, -184,
00501 -181, -178, -175, -171, -168, -165, -162, -159, -156, -153,
00502 -150, -147, -144, -140, -137, -134, -131, -128, -125, -122,
00503 -119, -115, -112, -109, -106, -103, -100, -97, -94, -90,
00504 -87, -84, -81, -78, -75, -72, -69, -65, -62, -59,
00505 -56, -53, -50, -47, -43, -40, -37, -34, -31, -28,
00506 -25, -21, -18, -15, -12, -9, -6, -3
00507 };
00508
00509 const Sfxp __COS_TABLE[TABLE_SIZE] = {
00510 1024, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023,
00511 1023, 1023, 1023, 1023, 1023, 1022, 1022, 1022, 1022, 1022,
00512 1022, 1021, 1021, 1021, 1021, 1020, 1020, 1020, 1020, 1019,
00513 1019, 1019, 1019, 1018, 1018, 1018, 1017, 1017, 1017, 1016,
00514 1016, 1015, 1015, 1015, 1014, 1014, 1013, 1013, 1012, 1012,
00515 1011, 1011, 1010, 1010, 1009, 1009, 1008, 1008, 1007, 1007,
00516 1006, 1006, 1005, 1004, 1004, 1003, 1003, 1002, 1001, 1001,
00517 1000, 999, 999, 998, 997, 997, 996, 995, 994, 994,
00518 993, 992, 991, 990, 990, 989, 988, 987, 986, 986,
00519 985, 984, 983, 982, 981, 980, 979, 978, 978, 977,
00520 976, 975, 974, 973, 972, 971, 970, 969, 968, 967,
00521 966, 965, 964, 963, 962, 960, 959, 958, 957, 956,
00522 955, 954, 953, 951, 950, 949, 948, 947, 946, 944,
00523 943, 942, 941, 939, 938, 937, 936, 934, 933, 932,
00524 930, 929, 928, 927, 925, 924, 922, 921, 920, 918,
00525 917, 916, 914, 913, 911, 910, 908, 907, 906, 904,
00526 903, 901, 900, 898, 897, 895, 894, 892, 890, 889,
00527 887, 886, 884, 883, 881, 879, 878, 876, 875, 873,
00528 871, 870, 868, 866, 865, 863, 861, 860, 858, 856,
00529 854, 853, 851, 849, 847, 846, 844, 842, 840, 839,
00530 837, 835, 833, 831, 829, 828, 826, 824, 822, 820,
00531 818, 816, 814, 813, 811, 809, 807, 805, 803, 801,
00532 799, 797, 795, 793, 791, 789, 787, 785, 783, 781,
00533 779, 777, 775, 773, 771, 769, 767, 765, 762, 760,
00534 758, 756, 754, 752, 750, 748, 745, 743, 741, 739,
00535 737, 735, 732, 730, 728, 726, 724, 721, 719, 717,
00536 715, 712, 710, 708, 706, 703, 701, 699, 696, 694,
00537 692, 690, 687, 685, 683, 680, 678, 675, 673, 671,
00538 668, 666, 664, 661, 659, 656, 654, 652, 649, 647,
00539 644, 642, 639, 637, 634, 632, 629, 627, 625, 622,
00540 620, 617, 615, 612, 609, 607, 604, 602, 599, 597,
00541 594, 592, 589, 587, 584, 581, 579, 576, 574, 571,
00542 568, 566, 563, 561, 558, 555, 553, 550, 547, 545,
00543 542, 539, 537, 534, 531, 529, 526, 523, 521, 518,
00544 515, 512, 510, 507, 504, 501, 499, 496, 493, 491,
00545 488, 485, 482, 479, 477, 474, 471, 468, 466, 463,
00546 460, 457, 454, 451, 449, 446, 443, 440, 437, 434,
00547 432, 429, 426, 423, 420, 417, 414, 412, 409, 406,
00548 403, 400, 397, 394, 391, 388, 386, 383, 380, 377,
00549 374, 371, 368, 365, 362, 359, 356, 353, 350, 347,
00550 344, 342, 339, 336, 333, 330, 327, 324, 321, 318,
00551 315, 312, 309, 306, 303, 300, 297, 294, 291, 288,
00552 285, 282, 279, 276, 273, 270, 267, 264, 260, 257,
00553
00554 254, 251, 248, 245, 242, 239, 236, 233, 230, 227,
00555 224, 221, 218, 215, 212, 209, 205, 202, 199, 196,
00556 193, 190, 187, 184, 181, 178, 175, 171, 168, 165,
00557 162, 159, 156, 153, 150, 147, 144, 140, 137, 134,
00558 131, 128, 125, 122, 119, 115, 112, 109, 106, 103,
00559 100, 97, 94, 90, 87, 84, 81, 78, 75, 72,
00560 69, 65, 62, 59, 56, 53, 50, 47, 43, 40,
00561 37, 34, 31, 28, 25, 21, 18, 15, 12, 9,
00562 6, 3, 0, -3, -6, -9, -12, -15, -18, -21,
00563 -25, -28, -31, -34, -37, -40, -43, -47, -50, -53,
00564 -56, -59, -62, -65, -69, -72, -75, -78, -81, -84,
00565 -87, -90, -94, -97, -100, -103, -106, -109, -112, -115,
00566 -119, -122, -125, -128, -131, -134, -137, -140, -144, -147,
00567 -150, -153, -156, -159, -162, -165, -168, -171, -175, -178,
00568 -181, -184, -187, -190, -193, -196, -199, -202, -205, -209,
00569 -212, -215, -218, -221, -224, -227, -230, -233, -236, -239,
00570 -242, -245, -248, -251, -254, -257, -260, -264, -267, -270,
00571 -273, -276, -279, -282, -285, -288, -291, -294, -297, -300,
00572 -303, -306, -309, -312, -315, -318, -321, -324, -327, -330,
00573 -333, -336, -339, -342, -344, -347, -350, -353, -356, -359,
00574 -362, -365, -368, -371, -374, -377, -380, -383, -386, -388,
00575 -391, -394, -397, -400, -403, -406, -409, -412, -414, -417,
00576 -420, -423, -426, -429, -432, -434, -437, -440, -443, -446,
00577 -449, -451, -454, -457, -460, -463, -466, -468, -471, -474,
00578 -477, -479, -482, -485, -488, -491, -493, -496, -499, -501,
00579 -504, -507, -510, -512, -515, -518, -521, -523, -526, -529,
00580 -531, -534, -537, -539, -542, -545, -547, -550, -553, -555,
00581 -558, -561, -563, -566, -568, -571, -574, -576, -579, -581,
00582 -584, -587, -589, -592, -594, -597, -599, -602, -604, -607,
00583 -609, -612, -615, -617, -620, -622, -625, -627, -629, -632,
00584 -634, -637, -639, -642, -644, -647, -649, -652, -654, -656,
00585 -659, -661, -664, -666, -668, -671, -673, -675, -678, -680,
00586 -683, -685, -687, -689, -692, -694, -696, -699, -701, -703,
00587 -706, -708, -710, -712, -715, -717, -719, -721, -724, -726,
00588 -728, -730, -732, -735, -737, -739, -741, -743, -745, -748,
00589 -750, -752, -754, -756, -758, -760, -762, -765, -767, -769,
00590 -771, -773, -775, -777, -779, -781, -783, -785, -787, -789,
00591 -791, -793, -795, -797, -799, -801, -803, -805, -807, -809,
00592 -811, -813, -814, -816, -818, -820, -822, -824, -826, -828,
00593 -829, -831, -833, -835, -837, -839, -840, -842, -844, -846,
00594 -847, -849, -851, -853, -854, -856, -858, -860, -861, -863,
00595 -865, -866, -868, -870, -871, -873, -875, -876, -878, -879,
00596 -881, -883, -884, -886, -887, -889, -890, -892, -894, -895,
00597 -897, -898, -900, -901, -903, -904, -906, -907, -908, -910,
00598 -911, -913, -914, -916, -917, -918, -920, -921, -922, -924,
00599 -925, -927, -928, -929, -930, -932, -933, -934, -936, -937,
00600 -938, -939, -941, -942, -943, -944, -946, -947, -948, -949,
00601 -950, -951, -953, -954, -955, -956, -957, -958, -959, -960,
00602 -962, -963, -964, -965, -966, -967, -968, -969, -970, -971,
00603 -972, -973, -974, -975, -976, -977, -978, -978, -979, -980,
00604 -981, -982, -983, -984, -985, -986, -986, -987, -988, -989,
00605 -990, -990, -991, -992, -993, -994, -994, -995, -996, -997,
00606 -997, -998, -999, -999, -1000, -1001, -1001, -1002, -1003, -1003,
00607 -1004, -1004, -1005, -1006, -1006, -1007, -1007, -1008, -1008, -1009,
00608 -1009, -1010, -1010, -1011, -1011, -1012, -1012, -1013, -1013, -1014,
00609 -1014, -1015, -1015, -1015, -1016, -1016, -1017, -1017, -1017, -1018,
00610 -1018, -1018, -1019, -1019, -1019, -1019, -1020, -1020, -1020, -1020,
00611 -1021, -1021, -1021, -1021, -1022, -1022, -1022, -1022, -1022, -1022,
00612 -1023, -1023, -1023, -1023, -1023, -1023, -1023, -1023, -1023, -1023,
00613 -1023, -1023, -1023, -1023, -1023, -1023, -1023, -1023, -1023, -1023,
00614 -1023, -1023, -1023, -1023, -1023, -1023, -1023, -1023, -1023, -1022,
00615 -1022, -1022, -1022, -1022, -1022, -1021, -1021, -1021, -1021, -1020,
00616 -1020, -1020, -1020, -1019, -1019, -1019, -1019, -1018, -1018, -1018,
00617 -1017, -1017, -1017, -1016, -1016, -1015, -1015, -1015, -1014, -1014,
00618 -1013, -1013, -1012, -1012, -1011, -1011, -1010, -1010, -1009, -1009,
00619 -1008, -1008, -1007, -1007, -1006, -1006, -1005, -1004, -1004, -1003,
00620 -1003, -1002, -1001, -1001, -1000, -999, -999, -998, -997, -997,
00621 -996, -995, -994, -994, -993, -992, -991, -990, -990, -989,
00622 -988, -987, -986, -986, -985, -984, -983, -982, -981, -980,
00623 -979, -978, -978, -977, -976, -975, -974, -973, -972, -971,
00624 -970, -969, -968, -967, -966, -965, -964, -963, -962, -960,
00625 -959, -958, -957, -956, -955, -954, -953, -951, -950, -949,
00626 -948, -947, -946, -944, -943, -942, -941, -939, -938, -937,
00627 -936, -934, -933, -932, -930, -929, -928, -927, -925, -924,
00628 -922, -921, -920, -918, -917, -916, -914, -913, -911, -910,
00629 -908, -907, -906, -904, -903, -901, -900, -898, -897, -895,
00630 -894, -892, -890, -889, -887, -886, -884, -883, -881, -879,
00631 -878, -876, -875, -873, -871, -870, -868, -866, -865, -863,
00632 -861, -860, -858, -856, -854, -853, -851, -849, -847, -846,
00633 -844, -842, -840, -839, -837, -835, -833, -831, -829, -828,
00634 -826, -824, -822, -820, -818, -816, -814, -813, -811, -809,
00635 -807, -805, -803, -801, -799, -797, -795, -793, -791, -789,
00636 -787, -785, -783, -781, -779, -777, -775, -773, -771, -769,
00637 -767, -765, -762, -760, -758, -756, -754, -752, -750, -748,
00638 -745, -743, -741, -739, -737, -735, -732, -730, -728, -726,
00639 -724, -721, -719, -717, -715, -712, -710, -708, -706, -703,
00640 -701, -699, -696, -694, -692, -690, -687, -685, -683, -680,
00641 -678, -675, -673, -671, -668, -666, -664, -661, -659, -656,
00642 -654, -652, -649, -647, -644, -642, -639, -637, -634, -632,
00643 -629, -627, -625, -622, -620, -617, -615, -612, -609, -607,
00644 -604, -602, -599, -597, -594, -592, -589, -587, -584, -581,
00645 -579, -576, -574, -571, -568, -566, -563, -561, -558, -555,
00646 -553, -550, -547, -545, -542, -539, -537, -534, -531, -529,
00647 -526, -523, -521, -518, -515, -512, -510, -507, -504, -501,
00648 -499, -496, -493, -491, -488, -485, -482, -479, -477, -474,
00649 -471, -468, -466, -463, -460, -457, -454, -451, -449, -446,
00650 -443, -440, -437, -434, -432, -429, -426, -423, -420, -417,
00651 -414, -412, -409, -406, -403, -400, -397, -394, -391, -388,
00652 -386, -383, -380, -377, -374, -371, -368, -365, -362, -359,
00653 -356, -353, -350, -347, -344, -342, -339, -336, -333, -330,
00654 -327, -324, -321, -318, -315, -312, -309, -306, -303, -300,
00655 -297, -294, -291, -288, -285, -282, -279, -276, -273, -270,
00656 -267, -264, -260, -257, -254, -251, -248, -245, -242, -239,
00657 -236, -233, -230, -227, -224, -221, -218, -215, -212, -209,
00658 -205, -202, -199, -196, -193, -190, -187, -184, -181, -178,
00659 -175, -171, -168, -165, -162, -159, -156, -153, -150, -147,
00660 -144, -140, -137, -134, -131, -128, -125, -122, -119, -115,
00661 -112, -109, -106, -103, -100, -97, -94, -90, -87, -84,
00662 -81, -78, -75, -72, -69, -65, -62, -59, -56, -53,
00663 -50, -47, -43, -40, -37, -34, -31, -28, -25, -21,
00664 -18, -15, -12, -9, -6, -3, 0, 3, 6, 9,
00665 12, 15, 18, 21, 25, 28, 31, 34, 37, 40,
00666 43, 47, 50, 53, 56, 59, 62, 65, 69, 72,
00667 75, 78, 81, 84, 87, 90, 94, 97, 100, 103,
00668 106, 109, 112, 115, 119, 122, 125, 128, 131, 134,
00669 137, 140, 144, 147, 150, 153, 156, 159, 162, 165,
00670 168, 171, 175, 178, 181, 184, 187, 190, 193, 196,
00671 199, 202, 205, 209, 212, 215, 218, 221, 224, 227,
00672 230, 233, 236, 239, 242, 245, 248, 251, 254, 257,
00673 260, 264, 267, 270, 273, 276, 279, 282, 285, 288,
00674 291, 294, 297, 300, 303, 306, 309, 312, 315, 318,
00675 321, 324, 327, 330, 333, 336, 339, 342, 344, 347,
00676 350, 353, 356, 359, 362, 365, 368, 371, 374, 377,
00677 380, 383, 386, 388, 391, 394, 397, 400, 403, 406,
00678 409, 412, 414, 417, 420, 423, 426, 429, 432, 434,
00679 437, 440, 443, 446, 449, 451, 454, 457, 460, 463,
00680 466, 468, 471, 474, 477, 479, 482, 485, 488, 490,
00681 493, 496, 499, 501, 504, 507, 510, 512, 515, 518,
00682 521, 523, 526, 529, 531, 534, 537, 539, 542, 545,
00683 547, 550, 553, 555, 558, 561, 563, 566, 568, 571,
00684 574, 576, 579, 581, 584, 587, 589, 592, 594, 597,
00685 599, 602, 604, 607, 609, 612, 615, 617, 620, 622,
00686 625, 627, 629, 632, 634, 637, 639, 642, 644, 647,
00687 649, 652, 654, 656, 659, 661, 664, 666, 668, 671,
00688 673, 675, 678, 680, 683, 685, 687, 689, 692, 694,
00689 696, 699, 701, 703, 706, 708, 710, 712, 715, 717,
00690 719, 721, 724, 726, 728, 730, 732, 735, 737, 739,
00691 741, 743, 745, 748, 750, 752, 754, 756, 758, 760,
00692 762, 765, 767, 769, 771, 773, 775, 777, 779, 781,
00693 783, 785, 787, 789, 791, 793, 795, 797, 799, 801,
00694 803, 805, 807, 809, 811, 813, 814, 816, 818, 820,
00695 822, 824, 826, 828, 829, 831, 833, 835, 837, 839,
00696 840, 842, 844, 846, 847, 849, 851, 853, 854, 856,
00697 858, 860, 861, 863, 865, 866, 868, 870, 871, 873,
00698 875, 876, 878, 879, 881, 883, 884, 886, 887, 889,
00699 890, 892, 894, 895, 897, 898, 900, 901, 903, 904,
00700 906, 907, 908, 910, 911, 913, 914, 916, 917, 918,
00701 920, 921, 922, 924, 925, 927, 928, 929, 930, 932,
00702 933, 934, 936, 937, 938, 939, 941, 942, 943, 944,
00703 946, 947, 948, 949, 950, 951, 953, 954, 955, 956,
00704 957, 958, 959, 960, 962, 963, 964, 965, 966, 967,
00705 968, 969, 970, 971, 972, 973, 974, 975, 976, 977,
00706 978, 978, 979, 980, 981, 982, 983, 984, 985, 986,
00707 986, 987, 988, 989, 990, 990, 991, 992, 993, 994,
00708 994, 995, 996, 997, 997, 998, 999, 999, 1000, 1001,
00709 1001, 1002, 1003, 1003, 1004, 1004, 1005, 1006, 1006, 1007,
00710 1007, 1008, 1008, 1009, 1009, 1010, 1010, 1011, 1011, 1012,
00711 1012, 1013, 1013, 1014, 1014, 1015, 1015, 1015, 1016, 1016,
00712 1017, 1017, 1017, 1018, 1018, 1018, 1019, 1019, 1019, 1019,
00713 1020, 1020, 1020, 1020, 1021, 1021, 1021, 1021, 1022, 1022,
00714 1022, 1022, 1022, 1022, 1023, 1023, 1023, 1023, 1023, 1023,
00715 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023
00716 };
00717
00718 const Sfxp __TAN_TABLE[TABLE_SIZE] = {
00719 0, 3, 6, 9, 12,
00720 15, 18, 21, 25, 28,
00721 31, 34, 37, 40, 44,
00722 47, 50, 53, 56, 59,
00723 62, 66, 69, 72, 75,
00724 78, 81, 85, 88, 91,
00725 94, 97, 100, 104, 107,
00726 110, 113, 116, 119, 123,
00727 126, 129, 132, 135, 139,
00728 142, 145, 148, 151, 155,
00729 158, 161, 164, 167, 171,
00730 174, 177, 180, 184, 187,
00731 190, 193, 197, 200, 203,
00732 206, 210, 213, 216, 220,
00733 223, 226, 229, 233, 236,
00734 239, 243, 246, 249, 253,
00735 256, 259, 263, 266, 269,
00736 273, 276, 279, 283, 286,
00737 290, 293, 296, 300, 303,
00738 307, 310, 314, 317, 320,
00739 324, 327, 331, 334, 338,
00740 341, 345, 348, 352, 355,
00741 359, 362, 366, 369, 373,
00742 377, 380, 384, 387, 391,
00743 395, 398, 402, 405, 409,
00744 413, 416, 420, 424, 427,
00745 431, 435, 438, 442, 446,
00746 450, 453, 457, 461, 465,
00747 469, 472, 476, 480, 484,
00748 488, 492, 495, 499, 503,
00749 507, 511, 515, 519, 523,
00750 527, 531, 535, 539, 543,
00751 547, 551, 555, 559, 563,
00752 567, 571, 575, 580, 584,
00753 588, 592, 596, 601, 605,
00754 609, 613, 618, 622, 626,
00755 630, 635, 639, 644, 648,
00756 652, 657, 661, 666, 670,
00757 675, 679, 684, 688, 693,
00758 697, 702, 707, 711, 716,
00759 721, 725, 730, 735, 740,
00760 744, 749, 754, 759, 764,
00761 769, 774, 779, 784, 789,
00762 794, 799, 804, 809, 814,
00763 819, 824, 829, 835, 840,
00764 845, 850, 856, 861, 866,
00765 872, 877, 883, 888, 894,
00766 899, 905, 911, 916, 922,
00767 928, 933, 939, 945, 951,
00768 957, 963, 968, 974, 980,
00769 986, 993, 999, 1005, 1011,
00770 1017, 1023, 1030, 1036, 1043,
00771 1049, 1055, 1062, 1068, 1075,
00772 1082, 1088, 1095, 1102, 1109,
00773 1115, 1122, 1129, 1136, 1143,
00774 1150, 1158, 1165, 1172, 1179,
00775 1187, 1194, 1201, 1209, 1216,
00776 1224, 1232, 1239, 1247, 1255,
00777 1263, 1271, 1279, 1287, 1295,
00778 1303, 1312, 1320, 1328, 1337,
00779 1345, 1354, 1363, 1371, 1380,
00780 1389, 1398, 1407, 1416, 1425,
00781 1435, 1444, 1453, 1463, 1473,
00782 1482, 1492, 1502, 1512, 1522,
00783 1532, 1542, 1553, 1563, 1573,
00784 1584, 1595, 1606, 1617, 1628,
00785 1639, 1650, 1661, 1673, 1684,
00786 1696, 1708, 1720, 1732, 1744,
00787 1756, 1769, 1782, 1794, 1807,
00788 1820, 1833, 1847, 1860, 1874,
00789 1887, 1901, 1915, 1929, 1944,
00790 1958, 1973, 1988, 2003, 2018,
00791 2034, 2049, 2065, 2081, 2098,
00792 2114, 2131, 2147, 2165, 2182,
00793 2199, 2217, 2235, 2253, 2272,
00794 2291, 2310, 2329, 2348, 2368,
00795 2388, 2409, 2429, 2450, 2472,
00796 2493, 2515, 2537, 2560, 2583,
00797 2606, 2630, 2654, 2679, 2703,
00798 2729, 2754, 2780, 2807, 2834,
00799 2861, 2889, 2918, 2947, 2976,
00800 3006, 3036, 3068, 3099, 3131,
00801 3164, 3198, 3232, 3267, 3302,
00802 3338, 3375, 3413, 3451, 3491,
00803 3531, 3572, 3613, 3656, 3700,
00804 3744, 3790, 3837, 3885, 3934,
00805 3984, 4035, 4088, 4141, 4197,
00806 4253, 4311, 4371, 4432, 4495,
00807 4560, 4626, 4694, 4764, 4836,
00808 4911, 4987, 5066, 5147, 5231,
00809 5318, 5407, 5499, 5595, 5693,
00810 5795, 5901, 6010, 6124, 6241,
00811 6364, 6491, 6622, 6760, 6903,
00812 7052, 7207, 7369, 7539, 7716,
00813 7902, 8097, 8302, 8517, 8743,
00814 8981, 9233, 9499, 9781, 10079,
00815 10396, 10734, 11094, 11478, 11890,
00816 12333, 12809, 13324, 13881, 14487,
00817 15148, 15871, 16667, 17546, 18523,
00818 19615, 20843, 22235, 23825, 25660,
00819 27800, 30330, 33365, 37074, 41711,
00820 47671, 55618, 66743, 83429, 111238,
00821 166849, 333632, 807831678, -333908, -166917,
00822 -111269, -83447, -66754, -55626, -47677,
00823 -41715, -37078, -33368, -30332, -27802,
00824 -25661, -23826, -22236, -20844, -19616,
00825 -18524, -17547, -16668, -15872, -15148,
00826 -14488, -13882, -13324, -12810, -12333,
00827 -11891, -11479, -11094, -10734, -10396,
00828 -10079, -9781, -9499, -9233, -8982,
00829 -8743, -8517, -8302, -8097, -7903,
00830 -7717, -7539, -7370, -7207, -7052,
00831 -6903, -6760, -6623, -6491, -6364,
00832 -6242, -6124, -6010, -5901, -5795,
00833 -5693, -5595, -5499, -5407, -5318,
00834 -5231, -5148, -5066, -4987, -4911,
00835 -4837, -4764, -4694, -4626, -4560,
00836 -4495, -4432, -4371, -4311, -4253,
00837 -4197, -4141, -4088, -4035, -3984,
00838 -3934, -3885, -3837, -3790, -3744,
00839 -3700, -3656, -3613, -3572, -3531,
00840 -3491, -3451, -3413, -3375, -3338,
00841 -3302, -3267, -3232, -3198, -3164,
00842 -3131, -3099, -3068, -3037, -3006,
00843 -2976, -2947, -2918, -2889, -2861,
00844 -2834, -2807, -2780, -2754, -2729,
00845 -2703, -2679, -2654, -2630, -2606,
00846 -2583, -2560, -2537, -2515, -2493,
00847 -2472, -2450, -2429, -2409, -2388,
00848 -2368, -2348, -2329, -2310, -2291,
00849 -2272, -2253, -2235, -2217, -2199,
00850 -2182, -2165, -2148, -2131, -2114,
00851 -2098, -2081, -2065, -2049, -2034,
00852 -2018, -2003, -1988, -1973, -1958,
00853 -1944, -1929, -1915, -1901, -1887,
00854 -1874, -1860, -1847, -1833, -1820,
00855 -1807, -1794, -1782, -1769, -1756,
00856 -1744, -1732, -1720, -1708, -1696,
00857 -1684, -1673, -1661, -1650, -1639,
00858 -1628, -1617, -1606, -1595, -1584,
00859 -1574, -1563, -1553, -1542, -1532,
00860 -1522, -1512, -1502, -1492, -1482,
00861 -1473, -1463, -1453, -1444, -1435,
00862 -1425, -1416, -1407, -1398, -1389,
00863 -1380, -1371, -1363, -1354, -1345,
00864 -1337, -1328, -1320, -1312, -1303,
00865 -1295, -1287, -1279, -1271, -1263,
00866 -1255, -1247, -1239, -1232, -1224,
00867 -1216, -1209, -1201, -1194, -1187,
00868 -1179, -1172, -1165, -1158, -1150,
00869 -1143, -1136, -1129, -1122, -1115,
00870 -1109, -1102, -1095, -1088, -1082,
00871 -1075, -1068, -1062, -1055, -1049,
00872 -1043, -1036, -1030, -1024, -1017,
00873 -1011, -1005, -999, -993, -986,
00874 -980, -974, -968, -963, -957,
00875 -951, -945, -939, -933, -928,
00876 -922, -916, -911, -905, -899,
00877 -894, -888, -883, -877, -872,
00878 -867, -861, -856, -850, -845,
00879 -840, -835, -829, -824, -819,
00880 -814, -809, -804, -799, -794,
00881 -789, -784, -779, -774, -769,
00882 -764, -759, -754, -749, -744,
00883 -740, -735, -730, -725, -721,
00884 -716, -711, -707, -702, -697,
00885 -693, -688, -684, -679, -675,
00886 -670, -666, -661, -657, -652,
00887 -648, -644, -639, -635, -630,
00888 -626, -622, -618, -613, -609,
00889 -605, -601, -596, -592, -588,
00890 -584, -580, -575, -571, -567,
00891 -563, -559, -555, -551, -547,
00892 -543, -539, -535, -531, -527,
00893 -523, -519, -515, -511, -507,
00894 -503, -499, -495, -492, -488,
00895 -484, -480, -476, -472, -469,
00896 -465, -461, -457, -453, -450,
00897 -446, -442, -438, -435, -431,
00898 -427, -424, -420, -416, -413,
00899 -409, -405, -402, -398, -395,
00900 -391, -387, -384, -380, -377,
00901 -373, -369, -366, -362, -359,
00902 -355, -352, -348, -345, -341,
00903 -338, -334, -331, -327, -324,
00904 -320, -317, -314, -310, -307,
00905 -303, -300, -296, -293, -290,
00906 -286, -283, -280, -276, -273,
00907 -269, -266, -263, -259, -256,
00908 -253, -249, -246, -243, -239,
00909 -236, -233, -229, -226, -223,
00910 -220, -216, -213, -210, -206,
00911 -203, -200, -197, -193, -190,
00912 -187, -184, -180, -177, -174,
00913 -171, -167, -164, -161, -158,
00914 -155, -151, -148, -145, -142,
00915 -139, -135, -132, -129, -126,
00916 -123, -119, -116, -113, -110,
00917 -107, -104, -100, -97, -94,
00918 -91, -88, -85, -81, -78,
00919 -75, -72, -69, -66, -62,
00920 -59, -56, -53, -50, -47,
00921 -44, -40, -37, -34, -31,
00922 -28, -25, -21, -18, -15,
00923 -12, -9, -6, -3, 0,
00924 3, 6, 9, 12, 15,
00925 18, 21, 25, 28, 31,
00926 34, 37, 40, 44, 47,
00927 50, 53, 56, 59, 62,
00928 66, 69, 72, 75, 78,
00929 81, 85, 88, 91, 94,
00930 97, 100, 104, 107, 110,
00931 113, 116, 119, 123, 126,
00932 129, 132, 135, 139, 142,
00933 145, 148, 151, 155, 158,
00934 161, 164, 167, 171, 174,
00935 177, 180, 184, 187, 190,
00936 193, 197, 200, 203, 206,
00937 210, 213, 216, 220, 223,
00938 226, 229, 233, 236, 239,
00939 243, 246, 249, 253, 256,
00940 259, 263, 266, 269, 273,
00941 276, 279, 283, 286, 290,
00942 293, 296, 300, 303, 307,
00943 310, 314, 317, 320, 324,
00944 327, 331, 334, 338, 341,
00945 345, 348, 352, 355, 359,
00946 362, 366, 369, 373, 377,
00947 380, 384, 387, 391, 394,
00948 398, 402, 405, 409, 413,
00949 416, 420, 424, 427, 431,
00950 435, 438, 442, 446, 450,
00951 453, 457, 461, 465, 469,
00952 472, 476, 480, 484, 488,
00953 492, 495, 499, 503, 507,
00954 511, 515, 519, 523, 527,
00955 531, 535, 539, 543, 547,
00956 551, 555, 559, 563, 567,
00957 571, 575, 580, 584, 588,
00958
00959 592, 596, 601, 605, 609,
00960 613, 618, 622, 626, 630,
00961 635, 639, 644, 648, 652,
00962 657, 661, 666, 670, 675,
00963 679, 684, 688, 693, 697,
00964 702, 707, 711, 716, 721,
00965 725, 730, 735, 740, 744,
00966 749, 754, 759, 764, 769,
00967 774, 779, 784, 789, 794,
00968 799, 804, 809, 814, 819,
00969 824, 829, 835, 840, 845,
00970 850, 856, 861, 866, 872,
00971 877, 883, 888, 894, 899,
00972 905, 911, 916, 922, 928,
00973 933, 939, 945, 951, 957,
00974 963, 968, 974, 980, 986,
00975 993, 999, 1005, 1011, 1017,
00976 1023, 1030, 1036, 1043, 1049,
00977 1055, 1062, 1068, 1075, 1082,
00978 1088, 1095, 1102, 1109, 1115,
00979 1122, 1129, 1136, 1143, 1150,
00980 1158, 1165, 1172, 1179, 1187,
00981 1194, 1201, 1209, 1216, 1224,
00982 1232, 1239, 1247, 1255, 1263,
00983 1271, 1279, 1287, 1295, 1303,
00984 1312, 1320, 1328, 1337, 1345,
00985 1354, 1363, 1371, 1380, 1389,
00986 1398, 1407, 1416, 1425, 1435,
00987 1444, 1453, 1463, 1473, 1482,
00988 1492, 1502, 1512, 1522, 1532,
00989 1542, 1553, 1563, 1573, 1584,
00990 1595, 1606, 1617, 1628, 1639,
00991 1650, 1661, 1673, 1684, 1696,
00992 1708, 1720, 1732, 1744, 1756,
00993 1769, 1782, 1794, 1807, 1820,
00994 1833, 1847, 1860, 1874, 1887,
00995 1901, 1915, 1929, 1944, 1958,
00996 1973, 1988, 2003, 2018, 2034,
00997 2049, 2065, 2081, 2098, 2114,
00998 2131, 2147, 2165, 2182, 2199,
00999 2217, 2235, 2253, 2272, 2291,
01000 2310, 2329, 2348, 2368, 2388,
01001 2409, 2429, 2450, 2472, 2493,
01002 2515, 2537, 2560, 2583, 2606,
01003 2630, 2654, 2679, 2703, 2729,
01004 2754, 2780, 2807, 2834, 2861,
01005 2889, 2918, 2947, 2976, 3006,
01006 3036, 3068, 3099, 3131, 3164,
01007 3198, 3232, 3267, 3302, 3338,
01008 3375, 3413, 3451, 3490, 3531,
01009 3571, 3613, 3656, 3700, 3744,
01010 3790, 3837, 3885, 3933, 3984,
01011 4035, 4087, 4141, 4197, 4253,
01012 4311, 4371, 4432, 4495, 4560,
01013 4626, 4694, 4764, 4836, 4911,
01014 4987, 5066, 5147, 5231, 5318,
01015 5407, 5499, 5595, 5693, 5795,
01016 5901, 6010, 6124, 6241, 6363,
01017 6490, 6622, 6760, 6903, 7052,
01018 7207, 7369, 7539, 7716, 7902,
01019 8097, 8302, 8517, 8743, 8981,
01020 9233, 9499, 9780, 10079, 10396,
01021 10733, 11093, 11478, 11890, 12333,
01022 12809, 13324, 13881, 14487, 15147,
01023 15870, 16666, 17545, 18522, 19614,
01024 20842, 22233, 23824, 25658, 27798,
01025 30327, 33362, 37071, 41706, 47665,
01026 55610, 66732, 83412, 111207, 166780,
01027 333356, 269277226, -334184, -166986, -111299,
01028 -83464, -66765, -55633, -47682, -41719,
01029 -37081, -33370, -30334, -27804, -25663,
01030 -23828, -22237, -20845, -19617, -18525,
01031 -17548, -16668, -15872, -15149, -14488,
01032 -13882, -13325, -12810, -12334, -11891,
01033 -11479, -11094, -10734, -10397, -10080,
01034 -9781, -9500, -9234, -8982, -8743,
01035 -8517, -8302, -8098, -7903, -7717,
01036 -7539, -7370, -7207, -7052, -6903,
01037 -6760, -6623, -6491, -6364, -6242,
01038 -6124, -6011, -5901, -5795, -5693,
01039 -5595, -5500, -5407, -5318, -5231,
01040 -5148, -5066, -4987, -4911, -4837,
01041 -4764, -4694, -4626, -4560, -4495,
01042 -4432, -4371, -4311, -4253, -4197,
01043 -4141, -4088, -4035, -3984, -3934,
01044 -3885, -3837, -3790, -3744, -3700,
01045 -3656, -3613, -3572, -3531, -3491,
01046 -3451, -3413, -3375, -3338, -3302,
01047 -3267, -3232, -3198, -3164, -3131,
01048 -3099, -3068, -3037, -3006, -2976,
01049 -2947, -2918, -2889, -2861, -2834,
01050 -2807, -2780, -2754, -2729, -2703,
01051 -2679, -2654, -2630, -2606, -2583,
01052 -2560, -2538, -2515, -2493, -2472,
01053 -2450, -2429, -2409, -2388, -2368,
01054 -2348, -2329, -2310, -2291, -2272,
01055 -2253, -2235, -2217, -2199, -2182,
01056 -2165, -2148, -2131, -2114, -2098,
01057 -2081, -2065, -2049, -2034, -2018,
01058 -2003, -1988, -1973, -1958, -1944,
01059 -1930, -1915, -1901, -1887, -1874,
01060 -1860, -1847, -1833, -1820, -1807,
01061 -1794, -1782, -1769, -1756, -1744,
01062 -1732, -1720, -1708, -1696, -1684,
01063 -1673, -1661, -1650, -1639, -1628,
01064 -1617, -1606, -1595, -1584, -1574,
01065 -1563, -1553, -1542, -1532, -1522,
01066 -1512, -1502, -1492, -1482, -1473,
01067 -1463, -1453, -1444, -1435, -1425,
01068 -1416, -1407, -1398, -1389, -1380,
01069 -1371, -1363, -1354, -1345, -1337,
01070 -1328, -1320, -1312, -1303, -1295,
01071 -1287, -1279, -1271, -1263, -1255,
01072 -1247, -1239, -1232, -1224, -1216,
01073 -1209, -1201, -1194, -1187, -1179,
01074 -1172, -1165, -1158, -1150, -1143,
01075 -1136, -1129, -1122, -1115, -1109,
01076 -1102, -1095, -1088, -1082, -1075,
01077 -1068, -1062, -1055, -1049, -1043,
01078 -1036, -1030, -1024, -1017, -1011,
01079 -1005, -999, -993, -986, -980,
01080 -974, -968, -963, -957, -951,
01081 -945, -939, -933, -928, -922,
01082 -916, -911, -905, -899, -894,
01083 -888, -883, -877, -872, -867,
01084 -861, -856, -850, -845, -840,
01085 -835, -829, -824, -819, -814,
01086 -809, -804, -799, -794, -789,
01087 -784, -779, -774, -769, -764,
01088 -759, -754, -749, -744, -740,
01089 -735, -730, -725, -721, -716,
01090 -711, -707, -702, -697, -693,
01091 -688, -684, -679, -675, -670,
01092 -666, -661, -657, -652, -648,
01093 -644, -639, -635, -630, -626,
01094 -622, -618, -613, -609, -605,
01095 -601, -596, -592, -588, -584,
01096 -580, -575, -571, -567, -563,
01097 -559, -555, -551, -547, -543,
01098 -539, -535, -531, -527, -523,
01099 -519, -515, -511, -507, -503,
01100 -499, -495, -492, -488, -484,
01101 -480, -476, -472, -469, -465,
01102 -461, -457, -453, -450, -446,
01103 -442, -438, -435, -431, -427,
01104 -424, -420, -416, -413, -409,
01105 -405, -402, -398, -395, -391,
01106 -387, -384, -380, -377, -373,
01107 -369, -366, -362, -359, -355,
01108 -352, -348, -345, -341, -338,
01109 -334, -331, -327, -324, -320,
01110 -317, -314, -310, -307, -303,
01111 -300, -296, -293, -290, -286,
01112 -283, -280, -276, -273, -269,
01113 -266, -263, -259, -256, -253,
01114 -249, -246, -243, -239, -236,
01115 -233, -229, -226, -223, -220,
01116 -216, -213, -210, -206, -203,
01117 -200, -197, -193, -190, -187,
01118 -184, -180, -177, -174, -171,
01119 -167, -164, -161, -158, -155,
01120 -151, -148, -145, -142, -139,
01121 -135, -132, -129, -126, -123,
01122 -119, -116, -113, -110, -107,
01123 -104, -100, -97, -94, -91,
01124 -88, -85, -81, -78, -75,
01125 -72, -69, -66, -62, -59,
01126 -56, -53, -50, -47, -44,
01127 -40, -37, -34, -31, -28,
01128 -25, -21, -18, -15, -12,
01129 -9, -6, -3
01130 };
01131