ref/include/f11_260.c
// Multiply two narrow residues and produce a narrow result.
Multiply two narrow residues and produce a narrow result.
Multiply two narrow residues and produce a narrow result .
void mul_narrow(
  residue_narrow_t *result, const residue_narrow_t *x,
  const residue_narrow_t *y) {
  residue_wide_t temp;
  for (int i = 0; i < NLIMBS; ++i) {
    temp.limbs[i] = 0;
    int i_2 = (i + (-(i & 1) & NLIMBS)) >> 1;
    for (int j = 1; j <= NLIMBS / 2; ++ j) {
      temp.limbs[i] +=
        ((int64_t) (x->limbs[wrap(i_2 + j)] - x->limbs[wrap(i_2 - j)])) *
        ((int64_t) (y->limbs[wrap(i_2 - j)] - y->limbs[wrap(i_2 + j)]));
    }
  }
  reduce_step_wide(&temp, &temp);
  reduce_step_wide(&temp, &temp);
  narrow(result, &temp);
}
void mul_narrow ( residue_narrow_t * result , const residue_narrow_t * x , const residue_narrow_t * y ) { residue_wide_t temp ; for ( int i = 0 ; i < NLIMBS ; ++ i ) { temp . limbs [ i ] = 0 ; int i_2 = ( i + ( - ( i & 1 ) & NLIMBS ) ) >> 1 ; for ( int j = 1 ; j <= NLIMBS / 2 ; ++ j ) { temp . limbs [ i ] += ( ( int64_t ) ( x -> limbs [ wrap ( i_2 + j ) ] - x -> limbs [ wrap ( i_2 - j ) ] ) ) * ( ( int64_t ) ( y -> limbs [ wrap ( i_2 - j ) ] - y -> limbs [ wrap ( i_2 + j ) ] ) ) ; } } reduce_step_wide ( & temp , & temp ) ; reduce_step_wide ( & temp , & temp ) ; narrow ( result , & temp ) ; }
Multiply two narrow residues and produce a narrow result.
Multiply two narrow residues and produce a narrow result .