ГОСТ Р 56047—2014
Файл: moddiff.h
#define L 4
struct moddiffin {
double win;
int Lcount;
double modtmp:
double mod[L];
double num2;
double denom2;
double num3;
double denom3;
};
struct moddiffout {
double ModDiffl;
double ModDiff2:
double TempWt;
>;
/* Function prototypes V
struct moddiffout moddiff(double \ double double *):
double ModDiffl(struct moddiffout. struct moddiffin int);
double ModDiff2(struct moddiffout. struct moddiffin *):
double ModDiff3(struct moddiffout. struct moddiffin ’);
/* Prototypes end 7
Файл: moddiff.c
include <stdlfc.h>
include <assert.h>
include <math.h>
include «common.h>
^include <moddiff.h>
extern double *fC;
extern int baric;
struct moddiffout
moddiff(double ‘Modtest, double ’Modref, double “Etilderef)
{
int k;
struct moddiffout out;
double Pthres;
out.ModDiffl = 0;
out.ModDiff2 = 0;
out.TempWt = 0;
for(k=0;k<bark;k++) {
// W.nModDiffIB && AvgModDiffIB
out.ModDiffl += module(Modtest(kl - Modref[k])/{1.0 + Modref[k]):
// AvgModDiff2B
if(Modtest[kJ > Modref[k])
out.ModDiff2 += module(Modtest[k] - Modrefjk])
/(0.01 + Modreflk]);
else
out.ModDiH2 += 0.1 ’module(Modtest[kJ - Modreflk])
/(0.01 + Modreflk]);
Pthres = p(10.0. 0.4*0.364*p(fClk]/1000.0. -0.8));
out.TempWt += Etildereflk]/(EtHdereflk] + p(Pthres. 0.3)‘ 100.0);
)
out.ModDiff1 *= (double)100.0,’bark;
out.ModDiff2 ’= (doubte)100.0.’bark;
79