/*****************************************************************************/ /* */ /* HISTOGRAM OF LIMB LENGTHS */ /* 11/28/09 (dkc) */ /* */ /* This C program compares the expected number of limbs of a given length */ /* to the actual number. The limbs must be alive. The order is 3*2**32. */ /* */ /*****************************************************************************/ #include <stdio.h> #include <math.h> void add64(unsigned int *a, unsigned int *b); void mul64_32(unsigned int a0, unsigned int a2, unsigned int m0, unsigned int *product); void div128_64(unsigned int a0, unsigned int a1, unsigned int a2, unsigned int a3, unsigned int *quotient, unsigned int d2, unsigned int d3); int main () { unsigned int P[3],Q[4]; unsigned int ho[256]; unsigned int v[14]={1,2,4,7,9,12,14,17,20,22,25,27,30,33}; unsigned int y[40]={0,3,6,8,11, // B (invalid lengths) 13,16,19,21,24, // B 26,29,32,34,37, // B 39,42,44,47,50, // C 52,55,57,60,63, // C 65,68,70,73,75, // D 78,81,83,86,88, // D 91,94,96,99,101}; // D // // fractions // unsigned int z[14*2]={1,6, // 1 1/2*3 1,6, // 2 1/(2**1)*(3**1) 1,24, // 4 1/(2**3)*(3**1) 1,216, // 7 1/(2**3)*(3**3) 5,1728, // 9 5/(2**6)*(3**3) 25,15552, // 12 25/(2**6)*(3**5) 13,62208, // 14 13/(2**8)*(3**5) 233,497664, // 17 233/(2**11)*(3**5) 695,13436928, // 20 695/(2**11)*(3**8) 6349,1024*59049, // 22 6349/(2**10)*(3**10) 3791,80621568, // 25 3791/(2**12)*(3**9) 2831,161243136, // 27 2831/(2**13)*(3**9) 3425,256*531441, // 30 3425/(2**8)*(3**12) 7359,1594323}; // 33 7359/(2**13)*(3**13) // // l=33 7359/(2**13)*(3**13) or 345/(2**7)*(3**14) or 8279/(2**10)*(3**15) // l=35 2979/(2**8)*(3**13) or 8937/(2**8)*(3**14) // Lots of solutions since histogram value is small. // unsigned int g,i,j,flag; unsigned int h[16*127]={ // 1, 0x00000000, 0x00000000, 0x01555555, 0x00000000, 0x00555556, 0x00000000, 0x00000000, 0x00097B42, 0x00000000, 0x0005ED0A, 0x00000000, 0x00000000, 0x00034ACD, 0x00000000, 0x00006D90, 0x00000000, 0x00000000, 0x0000F577, 0x00000000, 0x00000000, 0x00001B1D, 0x00000000, 0x0000370D, 0x00000000, 0x00000000, 0x000018A5, 0x00000000, 0x00000939, 0x00000000, 0x00000000, 0x00000D2B, 0x00000000, 0x00000000, 0x0000004C, 0x00000000, 0x000003D8, 0x00000000, 0x00000000, 0x00000112, 0x00000000, 0x000000E3, 0x00000000, 0x00000000, 0x000000D0, 0x00000000, 0x00000016, 0x00000000, 0x00000000, 0x00000059, 0x00000000, 0x00000000, 0x0000000B, 0x00000000, 0x0000000E, 0x00000000, 0x00000000, 0x0000000B, 0x00000000, 0x00000004, 0x00000000, 0x00000000, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 3, 0x00000000, 0x00000000, 0x01555556, 0x00000000, 0x00555555, 0x00000000, 0x00000000, 0x00097B42, 0x00000000, 0x0005ED0A, 0x00000000, 0x00000000, 0x00034ACC, 0x00000000, 0x00006D90, 0x00000000, 0x00000000, 0x0000F578, 0x00000000, 0x00000000, 0x00001B1C, 0x00000000, 0x0000370D, 0x00000000, 0x00000000, 0x000018A6, 0x00000000, 0x00000937, 0x00000000, 0x00000000, 0x00000D30, 0x00000000, 0x00000000, 0x0000004E, 0x00000000, 0x000003D3, 0x00000000, 0x00000000, 0x0000011F, 0x00000000, 0x000000E6, 0x00000000, 0x00000000, 0x000000CB, 0x00000000, 0x00000013, 0x00000000, 0x00000000, 0x00000050, 0x00000000, 0x00000000, 0x00000011, 0x00000000, 0x00000014, 0x00000000, 0x00000000, 0x0000000E, 0x00000000, 0x00000006, 0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 5, 0x00000000, 0x00000000, 0x01555555, 0x00000000, 0x00555555, 0x00000000, 0x00000000, 0x00097B42, 0x00000000, 0x0005ED0A, 0x00000000, 0x00000000, 0x00034ACC, 0x00000000, 0x00006D90, 0x00000000, 0x00000000, 0x0000F578, 0x00000000, 0x00000000, 0x00001B1C, 0x00000000, 0x0000370D, 0x00000000, 0x00000000, 0x000018A7, 0x00000000, 0x00000933, 0x00000000, 0x00000000, 0x00000D32, 0x00000000, 0x00000000, 0x0000004C, 0x00000000, 0x000003D5, 0x00000000, 0x00000000, 0x00000126, 0x00000000, 0x000000DE, 0x00000000, 0x00000000, 0x000000D6, 0x00000000, 0x00000017, 0x00000000, 0x00000000, 0x00000052, 0x00000000, 0x00000000, 0x00000005, 0x00000000, 0x00000019, 0x00000000, 0x00000000, 0x00000009, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x0000000D, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 7, 0x00000000, 0x00000000, 0x01555555, 0x00000000, 0x00555555, 0x00000000, 0x00000000, 0x00097B43, 0x00000000, 0x0005ED0A, 0x00000000, 0x00000000, 0x00034ACD, 0x00000000, 0x00006D91, 0x00000000, 0x00000000, 0x0000F576, 0x00000000, 0x00000000, 0x00001B1C, 0x00000000, 0x0000370C, 0x00000000, 0x00000000, 0x000018A8, 0x00000000, 0x00000933, 0x00000000, 0x00000000, 0x00000D30, 0x00000000, 0x00000000, 0x0000004E, 0x00000000, 0x000003D6, 0x00000000, 0x00000000, 0x00000120, 0x00000000, 0x000000E1, 0x00000000, 0x00000000, 0x000000C5, 0x00000000, 0x00000019, 0x00000000, 0x00000000, 0x00000050, 0x00000000, 0x00000000, 0x00000006, 0x00000000, 0x00000018, 0x00000000, 0x00000000, 0x00000008, 0x00000000, 0x00000005, 0x00000000, 0x00000000, 0x0000000D, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 9, 0x00000000, 0x00000000, 0x01555556, 0x00000000, 0x00555555, 0x00000000, 0x00000000, 0x00097B43, 0x00000000, 0x0005ED0A, 0x00000000, 0x00000000, 0x00034ACC, 0x00000000, 0x00006D91, 0x00000000, 0x00000000, 0x0000F576, 0x00000000, 0x00000000, 0x00001B1C, 0x00000000, 0x0000370D, 0x00000000, 0x00000000, 0x000018A9, 0x00000000, 0x00000935, 0x00000000, 0x00000000, 0x00000D31, 0x00000000, 0x00000000, 0x0000004D, 0x00000000, 0x000003D0, 0x00000000, 0x00000000, 0x0000010D, 0x00000000, 0x000000D5, 0x00000000, 0x00000000, 0x000000D6, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0x00000046, 0x00000000, 0x00000000, 0x0000000B, 0x00000000, 0x00000016, 0x00000000, 0x00000000, 0x0000000A, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x0000000B, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000006, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 11, 0x00000000, 0x00000000, 0x01555555, 0x00000000, 0x00555556, 0x00000000, 0x00000000, 0x00097B42, 0x00000000, 0x0005ED09, 0x00000000, 0x00000000, 0x00034ACC, 0x00000000, 0x00006D90, 0x00000000, 0x00000000, 0x0000F576, 0x00000000, 0x00000000, 0x00001B1D, 0x00000000, 0x0000370E, 0x00000000, 0x00000000, 0x000018A5, 0x00000000, 0x00000937, 0x00000000, 0x00000000, 0x00000D35, 0x00000000, 0x00000000, 0x0000004B, 0x00000000, 0x000003D4, 0x00000000, 0x00000000, 0x0000010D, 0x00000000, 0x000000D3, 0x00000000, 0x00000000, 0x000000C7, 0x00000000, 0x00000016, 0x00000000, 0x00000000, 0x00000049, 0x00000000, 0x00000000, 0x00000011, 0x00000000, 0x00000019, 0x00000000, 0x00000000, 0x0000000F, 0x00000000, 0x00000006, 0x00000000, 0x00000000, 0x00000006, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 13, 0x00000000, 0x00000000, 0x01555555, 0x00000000, 0x00555555, 0x00000000, 0x00000000, 0x00097B42, 0x00000000, 0x0005ED09, 0x00000000, 0x00000000, 0x00034ACD, 0x00000000, 0x00006D91, 0x00000000, 0x00000000, 0x0000F578, 0x00000000, 0x00000000, 0x00001B1D, 0x00000000, 0x0000370C, 0x00000000, 0x00000000, 0x000018A9, 0x00000000, 0x00000937, 0x00000000, 0x00000000, 0x00000D35, 0x00000000, 0x00000000, 0x0000004A, 0x00000000, 0x000003D1, 0x00000000, 0x00000000, 0x0000011A, 0x00000000, 0x000000D8, 0x00000000, 0x00000000, 0x000000CE, 0x00000000, 0x00000016, 0x00000000, 0x00000000, 0x00000049, 0x00000000, 0x00000000, 0x00000010, 0x00000000, 0x0000001C, 0x00000000, 0x00000000, 0x0000000F, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 15, 0x00000000, 0x00000000, 0x01555556, 0x00000000, 0x00555556, 0x00000000, 0x00000000, 0x00097B42, 0x00000000, 0x0005ED09, 0x00000000, 0x00000000, 0x00034ACC, 0x00000000, 0x00006D90, 0x00000000, 0x00000000, 0x0000F578, 0x00000000, 0x00000000, 0x00001B1E, 0x00000000, 0x0000370D, 0x00000000, 0x00000000, 0x000018A6, 0x00000000, 0x00000933, 0x00000000, 0x00000000, 0x00000D34, 0x00000000, 0x00000000, 0x0000004A, 0x00000000, 0x000003D4, 0x00000000, 0x00000000, 0x0000011E, 0x00000000, 0x000000DB, 0x00000000, 0x00000000, 0x000000C4, 0x00000000, 0x00000012, 0x00000000, 0x00000000, 0x0000004B, 0x00000000, 0x00000000, 0x0000000B, 0x00000000, 0x00000011, 0x00000000, 0x00000000, 0x0000000C, 0x00000000, 0x00000005, 0x00000000, 0x00000000, 0x00000009, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 17, 0x00000000, 0x00000000, 0x01555555, 0x00000000, 0x00555555, 0x00000000, 0x00000000, 0x00097B42, 0x00000000, 0x0005ED09, 0x00000000, 0x00000000, 0x00034ACC, 0x00000000, 0x00006D90, 0x00000000, 0x00000000, 0x0000F577, 0x00000000, 0x00000000, 0x00001B1F, 0x00000000, 0x0000370E, 0x00000000, 0x00000000, 0x000018A8, 0x00000000, 0x00000930, 0x00000000, 0x00000000, 0x00000D35, 0x00000000, 0x00000000, 0x0000004A, 0x00000000, 0x000003D3, 0x00000000, 0x00000000, 0x0000011C, 0x00000000, 0x000000E6, 0x00000000, 0x00000000, 0x000000D1, 0x00000000, 0x00000012, 0x00000000, 0x00000000, 0x00000058, 0x00000000, 0x00000000, 0x00000010, 0x00000000, 0x00000020, 0x00000000, 0x00000000, 0x0000000D, 0x00000000, 0x00000006, 0x00000000, 0x00000000, 0x00000009, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 19, 0x00000000, 0x00000000, 0x01555555, 0x00000000, 0x00555556, 0x00000000, 0x00000000, 0x00097B43, 0x00000000, 0x0005ED09, 0x00000000, 0x00000000, 0x00034ACD, 0x00000000, 0x00006D90, 0x00000000, 0x00000000, 0x0000F577, 0x00000000, 0x00000000, 0x00001B1F, 0x00000000, 0x0000370B, 0x00000000, 0x00000000, 0x000018A7, 0x00000000, 0x00000933, 0x00000000, 0x00000000, 0x00000D35, 0x00000000, 0x00000000, 0x00000048, 0x00000000, 0x000003D9, 0x00000000, 0x00000000, 0x0000010A, 0x00000000, 0x000000F3, 0x00000000, 0x00000000, 0x000000C4, 0x00000000, 0x00000014, 0x00000000, 0x00000000, 0x00000054, 0x00000000, 0x00000000, 0x0000000E, 0x00000000, 0x0000001D, 0x00000000, 0x00000000, 0x0000000E, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 21, 0x00000000, 0x00000000, 0x01555556, 0x00000000, 0x00555555, 0x00000000, 0x00000000, 0x00097B43, 0x00000000, 0x0005ED09, 0x00000000, 0x00000000, 0x00034ACC, 0x00000000, 0x00006D91, 0x00000000, 0x00000000, 0x0000F576, 0x00000000, 0x00000000, 0x00001B21, 0x00000000, 0x0000370D, 0x00000000, 0x00000000, 0x000018A7, 0x00000000, 0x00000935, 0x00000000, 0x00000000, 0x00000D37, 0x00000000, 0x00000000, 0x0000004A, 0x00000000, 0x000003D6, 0x00000000, 0x00000000, 0x0000010F, 0x00000000, 0x000000EB, 0x00000000, 0x00000000, 0x000000CA, 0x00000000, 0x00000013, 0x00000000, 0x00000000, 0x00000052, 0x00000000, 0x00000000, 0x0000000F, 0x00000000, 0x00000014, 0x00000000, 0x00000000, 0x0000000F, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x0000000D, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 23, 0x00000000, 0x00000000, 0x01555555, 0x00000000, 0x00555555, 0x00000000, 0x00000000, 0x00097B42, 0x00000000, 0x0005ED09, 0x00000000, 0x00000000, 0x00034ACC, 0x00000000, 0x00006D90, 0x00000000, 0x00000000, 0x0000F577, 0x00000000, 0x00000000, 0x00001B21, 0x00000000, 0x0000370E, 0x00000000, 0x00000000, 0x000018A8, 0x00000000, 0x00000937, 0x00000000, 0x00000000, 0x00000D37, 0x00000000, 0x00000000, 0x0000004C, 0x00000000, 0x000003D2, 0x00000000, 0x00000000, 0x00000111, 0x00000000, 0x000000EA, 0x00000000, 0x00000000, 0x000000C9, 0x00000000, 0x00000018, 0x00000000, 0x00000000, 0x00000054, 0x00000000, 0x00000000, 0x0000000C, 0x00000000, 0x00000015, 0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 25, 0x00000000, 0x00000000, 0x01555555, 0x00000000, 0x00555555, 0x00000000, 0x00000000, 0x00097B42, 0x00000000, 0x0005ED09, 0x00000000, 0x00000000, 0x00034ACE, 0x00000000, 0x00006D91, 0x00000000, 0x00000000, 0x0000F579, 0x00000000, 0x00000000, 0x00001B20, 0x00000000, 0x0000370C, 0x00000000, 0x00000000, 0x000018A5, 0x00000000, 0x00000935, 0x00000000, 0x00000000, 0x00000D34, 0x00000000, 0x00000000, 0x0000004B, 0x00000000, 0x000003D2, 0x00000000, 0x00000000, 0x0000011E, 0x00000000, 0x000000E2, 0x00000000, 0x00000000, 0x000000CA, 0x00000000, 0x00000015, 0x00000000, 0x00000000, 0x00000054, 0x00000000, 0x00000000, 0x0000000C, 0x00000000, 0x00000017, 0x00000000, 0x00000000, 0x00000013, 0x00000000, 0x00000005, 0x00000000, 0x00000000, 0x00000005, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 27, 0x00000000, 0x00000000, 0x01555556, 0x00000000, 0x00555555, 0x00000000, 0x00000000, 0x00097B42, 0x00000000, 0x0005ED09, 0x00000000, 0x00000000, 0x00034ACC, 0x00000000, 0x00006D91, 0x00000000, 0x00000000, 0x0000F577, 0x00000000, 0x00000000, 0x00001B20, 0x00000000, 0x0000370D, 0x00000000, 0x00000000, 0x000018A9, 0x00000000, 0x00000930, 0x00000000, 0x00000000, 0x00000D35, 0x00000000, 0x00000000, 0x0000004B, 0x00000000, 0x000003CD, 0x00000000, 0x00000000, 0x00000125, 0x00000000, 0x000000DE, 0x00000000, 0x00000000, 0x000000D1, 0x00000000, 0x00000019, 0x00000000, 0x00000000, 0x00000054, 0x00000000, 0x00000000, 0x0000000B, 0x00000000, 0x00000018, 0x00000000, 0x00000000, 0x0000000C, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x0000000A, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 29, 0x00000000, 0x00000000, 0x01555555, 0x00000000, 0x00555556, 0x00000000, 0x00000000, 0x00097B43, 0x00000000, 0x0005ED0A, 0x00000000, 0x00000000, 0x00034ACC, 0x00000000, 0x00006D90, 0x00000000, 0x00000000, 0x0000F576, 0x00000000, 0x00000000, 0x00001B1F, 0x00000000, 0x0000370E, 0x00000000, 0x00000000, 0x000018A7, 0x00000000, 0x00000933, 0x00000000, 0x00000000, 0x00000D32, 0x00000000, 0x00000000, 0x0000004E, 0x00000000, 0x000003D7, 0x00000000, 0x00000000, 0x0000011C, 0x00000000, 0x000000DF, 0x00000000, 0x00000000, 0x000000C8, 0x00000000, 0x00000017, 0x00000000, 0x00000000, 0x0000005F, 0x00000000, 0x00000000, 0x0000000B, 0x00000000, 0x00000011, 0x00000000, 0x00000000, 0x0000000A, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 31, 0x00000000, 0x00000000, 0x01555555, 0x00000000, 0x00555555, 0x00000000, 0x00000000, 0x00097B43, 0x00000000, 0x0005ED0A, 0x00000000, 0x00000000, 0x00034ACC, 0x00000000, 0x00006D90, 0x00000000, 0x00000000, 0x0000F576, 0x00000000, 0x00000000, 0x00001B1E, 0x00000000, 0x0000370D, 0x00000000, 0x00000000, 0x000018A8, 0x00000000, 0x00000935, 0x00000000, 0x00000000, 0x00000D2E, 0x00000000, 0x00000000, 0x0000004E, 0x00000000, 0x000003D1, 0x00000000, 0x00000000, 0x00000112, 0x00000000, 0x000000E4, 0x00000000, 0x00000000, 0x000000D4, 0x00000000, 0x00000016, 0x00000000, 0x00000000, 0x00000052, 0x00000000, 0x00000000, 0x0000000D, 0x00000000, 0x0000000F, 0x00000000, 0x00000000, 0x0000000F, 0x00000000, 0x00000006, 0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000005, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000}; int k; double r; unsigned int S[2],T[2]; FILE *Outfp; Outfp = fopen("outa32.dat","w"); // // sum up histogram bins // S[0]=0; S[1]=0; for (i=0; i<127; i++) { ho[i]=0; for (j=0; j<16; j++) ho[i]=ho[i]+h[127*j+i]; T[0]=0; T[1]=ho[i]; add64(T, S); } printf("sum=%#10x %#10x \n",S[0],S[1]); printf("\n"); for (i=0; i<40; i++) { if (ho[y[i]]!=0) { printf("error: invalid length=%d \n",y[i]); goto zskip; } } g=0x80000000; for (i=1; i<14; i++) { r=(double)g; r=r*(double)z[2*i]; r=r/(double)z[2*i+1]; if (i==13) r=r/(double)8192; j=(unsigned int)r; j=j+1; mul64_32(0, g, z[2*i], P); div128_64(P[0], P[1], P[2], 0, Q, 0, z[2*i+1]); if (i==13) div128_64(Q[0], Q[1], Q[2], Q[3], Q, 0, 8192); if (((j-Q[2])!=0)&&((j-Q[2])!=1)) { printf("rounding error: j=%#10x, Q=%#10x %#10x %#10x %#10x\n",j,Q[0],Q[1],Q[2],Q[3]); // goto zskip; } k=Q[2]+(Q[3]>>31)-(int)ho[v[i]]; flag=0; if ((i==1)&&(k!=0)) // 2 (k is rounded) flag=1; if ((i==2)&&(k!=0)) // 4 flag=1; if ((i==3)&&(k!=0)) // 7 flag=1; if ((i==4)&&(k!=1)) // 9 flag=1; if ((i==5)&&(k!=0)) // 12 flag=1; if ((i==6)&&(k!=-1)) // 14 flag=1; if ((i==7)&&(k!=1)) // 17 flag=1; if ((i==8)&&(k!=1)) // 20 flag=1; if ((i==9)&&(k!=1)) // 22 flag=1; if ((i==10)&&(k!=1)) // 25 flag=1; if ((i==11)&&(k!=0)) // 27 flag=1; if ((i==12)&&(k!=1)) // 30 flag=1; if ((i==13)&&(k!=0)) // 33 flag=1; if (flag!=0) { printf("error: j=%d, h=%d, v=%d, i=%d, r=%f \n",Q[2]+(Q[3]>>31),ho[v[i]],v[i],i,r); // goto zskip; } else { printf("l=%d, j=%d, h=%d, r=%d, d=%d \n",v[i],Q[2]+(Q[3]>>31),ho[v[i]],Q[3]>>31,Q[2]+(Q[3]>>31)-ho[v[i]]); } } zskip: printf("\n"); for (j=0; j<100; j++) { if (ho[j]!=0) printf(" %d %d \n",j,ho[j]); } fclose(Outfp); return(0); }