// This computes reciprocal estimate from table with interpolation. #include #include typedef struct{short r; short d;} en; static en T[32]; int main(){int er=0; for(int j=32; j<64; ++j) T[j-32] = (en){(1<<20)/((j<<5)+1), (1<<21)/(j*j+1)}; for(int j=0; j<32; ++j) printf("%02x %4x %4x\n", j, T[j].r, T[j].d); if(1) for(int j=1024; j<2048; ++j){en r = T[(j-1024)>>5]; int w = r.r - (((j&31)*r.d)>>11), g = (1<<20)/(j+1); {int ae = abs(g-w); er = er