ГОСТ Р ИСО/МЭК 10373-6—2015
р-р->sig;
I
previaus->aig-new;
/* Multiplies order polynomials supposing (x’2 ‘b*x e) */
/* b and c are complex values stored in a table where even element.s are */
/* real and odd elements imaginary */
double *mult_poli {int nurc_pol, double *b, double *c)
l
int r-
0
;
int y-0;
double *real
7
double «imag;
double ’vector;
double *new_real;
double ’newunag;
double real_b-0;
double real c—0;
double imag_b-0;
doubie imag e—
0
;
real-(double *)calloc(4*num_pol, sizeol(double;);
imag-(double *>calloe(4*num_pol, sizeo£(double)};
new_real-(double *)calloc(4*num_pol, sized(double}>;
new_imag-(double *>calloe(4»num_pol, sizeof(double)>;
vector-(double ♦)caiioc(4*num_pol, sizeof(double));
re a l [ 0 ] - d 0 ] ;
r e a l [ 1 ] —b 10];
re a l 1 2 ) - 1 ;
imag(01- с | 1 1 ;
imag|1 ] —b 1 1 1 ;
imag
1 2
]-0;
tor (i-l; i<(4*num pol)i»*)
\
real - -
0
;
itsag!.’-0;
2
Lor (y-1; y<num_pol; y*M
<
// Selects va.ues b and c
rea._b-b’2Ty’;
real_c-c"
2
*y:;
itsag_b-b’2*у•1’;
irr.ag_c-c"*y*I.;
lor (.-0; r<-(2*nurr._pol-2); .-*)
I
П Starts with coefl *c*
newreal(i1‘-real[1]*real_e-imagli]*lmeg_c;
new imagli|+-real[i|’image»imag(l)*real_e;
// Continues with coeff "b"
new_real(1‘11‘-real(i)*real_h-imag[i]’lmsgjn;
new_imag{t‘-l)’*-reaHtl»imag_h*lm-agI1|*xeal_b;
// Finishes with coeif **lw
new real[i*2)‘-real!l);
new_imag(i•21f-imag[i];
64