28 static double PTabs(
double);
29 static double PTsgn(
double);
30 static double PTplus(
double,
double);
31 static double PTminus(
double,
double);
32 static double PTtimes(
double,
double);
33 static double PTdivide(
double,
double);
34 static double PTpower(
double,
double);
35 static double PTacos(
double);
36 static double PTasin(
double);
37 static double PTatan(
double);
39 static double PTacosh(
double);
40 static double PTasinh(
double);
41 static double PTatanh(
double);
43 static double PTcos(
double);
44 static double PTcosh(
double);
45 static double PTexp(
double);
46 static double PTln(
double);
47 static double PTlog(
double);
48 static double PTsin(
double);
49 static double PTsinh(
double);
50 static double PTsqrt(
double);
51 static double PTtan(
double);
52 static double PTtanh(
double);
61 static double PTabs();
62 static double PTsgn();
72 static double PTacosh();
73 static double PTasinh();
74 static double PTatanh();
76 static double PTcos();
78 static double PTexp();
80 static double PTlog();
81 static double PTsin();
84 static double PTtan();
92 #define MODULUS(NUM,LIMIT) ((NUM) - ((int) ((NUM) / (LIMIT))) * (LIMIT)) 142 #define V1 p->tranparms[0] 143 #define V2 p->tranparms[1] 144 #define TD p->tranparms[2] 145 #define TR p->tranparms[3] 146 #define TF p->tranparms[4] 147 #define PW p->tranparms[5] 148 #define PER p->tranparms[6] 150 #define SPER p->tranparms[2] 151 #define SDEL p->tranparms[3] 153 #define VO p->tranparms[0] 154 #define VA p->tranparms[1] 155 #define FREQ p->tranparms[2] 156 #define TDL p->tranparms[3] 157 #define THETA p->tranparms[4] 159 #define TD1 p->tranparms[2] 160 #define TAU1 p->tranparms[3] 161 #define TD2 p->tranparms[4] 162 #define TAU2 p->tranparms[5] 164 #define FC p->tranparms[2] 165 #define MDI p->tranparms[3] 166 #define FS p->tranparms[4] 176 double time, basetime, value;
183 basetime =
PER * (int)(time/
PER);
186 if (time < TR || time >= pw +
TF) {
188 if (time > 0 && time <
TR)
189 value += time* *p->trancache;
194 value += (time - pw)* *(p->trancache+1);
201 for (i = 7; i < p->numtrancoeffs; i++) {
202 time = *t - p->trancoeffs[i];
205 basetime =
PER * (int)(time/
PER);
208 if (time < TR || time >= pw +
TF) {
209 if (time > 0 && time <
TR)
210 value += time* *p->trancache;
215 value += (time - pw)* *(p->trancache+1);
228 if (*t >= (*p->trancoeffs+p->numtrancoeffs-2))
229 return (*(p->trancoeffs+p->numtrancoeffs-1));
230 if (p->pwlindex + 2 < p->numtrancoeffs) {
232 if (*t <= *(p->trancoeffs+p->pwlindex+2))
break;
234 if (p->pwlindex >= p->numtrancoeffs)
break;
238 if (*t < *(p->trancoeffs+p->pwlindex) && p->pwlindex)
242 if (!p->pwlindex && *t <= *(p->trancoeffs)) {
243 return (*(p->trancoeffs+1));
245 if (p->pwlindex >= p->numtrancoeffs) {
246 return (*(p->trancoeffs+p->numtrancoeffs-1));
248 return ( *(p->trancoeffs+p->pwlindex+1) +
249 *(p->trancache + (p->pwlindex >> 1)) *
250 (*t - *(p->trancoeffs+p->pwlindex)) );
321 {
return arg >= 0.0 ? arg : -arg; }
328 {
return arg > 0.0 ? 1.0 : arg < 0.0 ? -1.0 : 0.0; }
335 {
return (arg1 + arg2); }
342 {
return (arg1 - arg2); }
349 {
return (arg1 * arg2); }
365 return (arg1 / arg2);
373 {
return (pow(arg1, arg2)); }
380 {
return (acos(arg)); }
387 {
return (asin(arg)); }
394 {
return (atan(arg)); }
403 {
return (
acosh(arg)); }
410 {
return (
asinh(arg)); }
417 {
return (
atanh(arg)); }
433 {
return (cosh(arg)); }
440 {
return (exp(arg)); }
476 {
return (sinh(arg)); }
501 {
return (tanh(arg)); }
struct sPTfunc PTtFuncs[]
static double PTtSpulse()
#define MODULUS(NUM, LIMIT)