src/libm/k_rem_pio2.c
changeset 10650 b6ec7005ca15
parent 8670 0c15c8a2f8c3
child 11683 48bcba563d9c
equal deleted inserted replaced
10649:ddd8049e9d39 10650:b6ec7005ca15
   202     for (i = 0; i <= m; i++, j++)
   202     for (i = 0; i <= m; i++, j++)
   203         f[i] = (j < 0) ? zero : (double) ipio2[j];
   203         f[i] = (j < 0) ? zero : (double) ipio2[j];
   204 
   204 
   205     /* compute q[0],q[1],...q[jk] */
   205     /* compute q[0],q[1],...q[jk] */
   206     for (i = 0; i <= jk; i++) {
   206     for (i = 0; i <= jk; i++) {
   207         for (j = 0, fw = 0.0; j <= jx; j++)
   207         for (j = 0, fw = 0.0; j <= jx; j++) {
   208             fw += x[j] * f[jx + i - j];
   208             const int32_t idx = jx + i - j;
       
   209             SDL_assert(idx >= 0);
       
   210             SDL_assert(idx < 20);
       
   211             SDL_assert(idx <= m);
       
   212             fw += x[j] * f[idx];
       
   213         }
   209         q[i] = fw;
   214         q[i] = fw;
   210     }
   215     }
   211 
   216 
   212     jz = jk;
   217     jz = jk;
   213   recompute:
   218   recompute: