/*Translated by FOR_C, v3.4.2 (-), on 07/09/115 at 08:33:19 */ /*FOR_C Options SET: ftn=u io=c no=p op=aimnv pf=,p_stcst s=dbov str=l x=f - prototypes */ #include #include "fcrt.h" #include #include #include "p_stcst.h" /* program DRSTCST *>> 1996-06-05 DRSTCST Krogh Fixes for conversion to C. *>> 1996-05-28 DRSTCST Krogh Moved formats up. *>> 1994-10-19 DRSTCST Krogh Changes to use M77CON *>> 1994-08-09 DRSTCST WVS Remove '0' from format *>> 1992-04-22 DRSTCST CAO commented program statement *>> 1989-05-08 DRSTCST FTK, CLL *>> 1989-05-04 DRSTCST FTK, CLL * Driver to demonstrate STCST * ------------------------------------------------------------------ *--S replaces "?": DR?TCST, ?TCST * ------------------------------------------------------------------ */ /* PARAMETER translations */ #define KSKIP 10 #define M 6 #define N 65 #define ND 1 #define ONE 1.e0 #define PI 3.1415926535897932384e0 #define ZERO 0.e0 /* end of PARAMETER translations */ int main( ) { long int k, ms; float cos1, deltao, deltat, f[65], ftrue, omega, s[32], sin1, t; static float ttime = 10.e0; static long ma[1]={M}; /* OFFSET Vectors w/subscript range: 1 to dimension */ float *const F = &f[0] - 1; long *const Ma = &ma[0] - 1; float *const S = &s[0] - 1; /* end of OFFSET VECTORS */ /* parameter (N = 2 ** M + 1) */ /* ------------------------------------------------------------------ */ sin1 = sinf( ONE ); cos1 = cosf( ONE ); deltat = ttime/(float)( N - 1 ); deltao = (float)( KSKIP )*(PI/ttime); t = ZERO; /* Compute (TTIME / 2 ) * F(T) */ F[1] = ttime/PI; for (k = 2; k <= N; k++) { t += deltat; F[k] = ttime*sinhf( t )/sinhf( PI*t ); } ms = 0; stcst( f, "C", "A", ma, ND, &ms, s ); omega = ZERO; printf("\n K OMEGA COMPUTED TRUE\n"); for (k = 1; k <= N; k += KSKIP) { ftrue = sin1/(coshf( omega ) + cos1); printf(" %3ld%13.5e%15.7e%15.7e\n", k, omega, F[k], ftrue); omega += deltao; } exit(0); } /* end of function */