#include <perms.h>
// Edinburgh IMP77 Compiler - Version 8.4
//
// 1 %begin
int main(int argc, char **argv) { /*%begin*/
_imp_enter(main);
_imp_initialise(argc, argv);
// 2 %const %string (1) snl = "
const _imp_string1 SNL = _imp_str_init("\n");
// 3+ "
// 4
// 5 %routine tobern2(%long %real a0, %long %real a1, %long %real a2, %long %real %name b0, %long %real %name b1, %long %real %name b2)
void TOBERN2(double A0, double A1, double A2, double *B0, double *B1, double *B2) {
_imp_enter(TOBERN2);
// 6 b0 = a0
*B0 = A0;
// 7 b1 = a0 + a1 / 2
*B1 = A0 + (double)(A1 / 2);
// 8 b2 = a0 + a1 + a2
*B2 = A0 + A1 + A2;
// 9 %end
_imp_return;
_imp_begin_backtrace(TOBERN2);
_imp_diagf("\n\nArguments:\n\n");
if (__builtin_isnan(A0))
_imp_diagf("A0 = <UNASSIGNED REAL>\n");
else
_imp_diagf("A0 = %LE\n", (long double)A0);
if (__builtin_isnan(A1))
_imp_diagf("A1 = <UNASSIGNED REAL>\n");
else
_imp_diagf("A1 = %LE\n", (long double)A1);
if (__builtin_isnan(A2))
_imp_diagf("A2 = <UNASSIGNED REAL>\n");
else
_imp_diagf("A2 = %LE\n", (long double)A2);
_imp_diagf("B0 = %LE\n", (long double)*B0);
_imp_diagf("B1 = %LE\n", (long double)*B1);
_imp_diagf("B2 = %LE\n", (long double)*B2);
_imp_diagf("\nLocal Variables:\n\n");
_imp_end_backtrace();
} /* end of TOBERN2 */
// 10
// 11 { uses de Casteljau’s algorithm }
// 12 %long %real %fn evalbern2(%long %real b0, %long %real b1, %long %real b2, %long %real t)
double EVALBERN2(double B0, double B1, double B2, double T) {
_imp_enter(EVALBERN2);
// 13 %long %real s = 1.0 - t
double S = __builtin_nan("");
S = 1.0 - T;
// 14 %long %real b01 = s * b0 + t * b1
double B01 = __builtin_nan("");
B01 = S * B0 + T * B1;
// 15 %long %real b12 = s * b1 + t * b2
double B12 = __builtin_nan("");
B12 = S * B1 + T * B2;
// 16 %result = s * b01 + t * b12
_imp_result(S * B01 + T * B12);
// 17 %end
_imp_begin_backtrace(EVALBERN2);
_imp_diagf("\n\nArguments:\n\n");
if (__builtin_isnan(B0))
_imp_diagf("B0 = <UNASSIGNED REAL>\n");
else
_imp_diagf("B0 = %LE\n", (long double)B0);
if (__builtin_isnan(B1))
_imp_diagf("B1 = <UNASSIGNED REAL>\n");
else
_imp_diagf("B1 = %LE\n", (long double)B1);
if (__builtin_isnan(B2))
_imp_diagf("B2 = <UNASSIGNED REAL>\n");
else
_imp_diagf("B2 = %LE\n", (long double)B2);
if (__builtin_isnan(T))
_imp_diagf("T = <UNASSIGNED REAL>\n");
else
_imp_diagf("T = %LE\n", (long double)T);
_imp_diagf("\nLocal Variables:\n\n");
_imp_bt_real(S);
_imp_bt_real(B01);
_imp_bt_real(B12);
_imp_end_backtrace();
} /* end of EVALBERN2 */
// 18
// 19 %routine tobern3(%long %real a0, %long %real a1, %long %real a2, %long %real a3, %long %real %name b0, %long %real %name b1, %long %real %name b2, %long %real %name b3)
void TOBERN3(double A0, double A1, double A2, double A3, double *B0, double *B1, double *B2, double *B3) {
_imp_enter(TOBERN3);
// 20 b0 = a0
*B0 = A0;
// 21 b1 = a0 + a1 / 3
*B1 = A0 + (double)(A1 / 3);
// 22 b2 = a0 + a1 * 2/3 + a2 / 3
*B2 = A0 + (double)((A1 * 2) / 3) + (double)(A2 / 3);
// 23 b3 = a0 + a1 + a2 + a3
*B3 = A0 + A1 + A2 + A3;
// 24 %end
_imp_return;
_imp_begin_backtrace(TOBERN3);
_imp_diagf("\n\nArguments:\n\n");
if (__builtin_isnan(A0))
_imp_diagf("A0 = <UNASSIGNED REAL>\n");
else
_imp_diagf("A0 = %LE\n", (long double)A0);
if (__builtin_isnan(A1))
_imp_diagf("A1 = <UNASSIGNED REAL>\n");
else
_imp_diagf("A1 = %LE\n", (long double)A1);
if (__builtin_isnan(A2))
_imp_diagf("A2 = <UNASSIGNED REAL>\n");
else
_imp_diagf("A2 = %LE\n", (long double)A2);
if (__builtin_isnan(A3))
_imp_diagf("A3 = <UNASSIGNED REAL>\n");
else
_imp_diagf("A3 = %LE\n", (long double)A3);
_imp_diagf("B0 = %LE\n", (long double)*B0);
_imp_diagf("B1 = %LE\n", (long double)*B1);
_imp_diagf("B2 = %LE\n", (long double)*B2);
_imp_diagf("B3 = %LE\n", (long double)*B3);
_imp_diagf("\nLocal Variables:\n\n");
_imp_end_backtrace();
} /* end of TOBERN3 */
// 25
// 26 { uses de Casteljau’s algorithm }
// 27 %long %real %fn evalbern3(%long %real b0, %long %real b1, %long %real b2, %long %real b3, %long %real t)
double EVALBERN3(double B0, double B1, double B2, double B3, double T) {
_imp_enter(EVALBERN3);
// 28 %long %real s = 1 - t
double S = __builtin_nan("");
S = 1 - T;
// 29 %long %real b01 = s * b0 + t * b1
double B01 = __builtin_nan("");
B01 = S * B0 + T * B1;
// 30 %long %real b12 = s * b1 + t * b2
double B12 = __builtin_nan("");
B12 = S * B1 + T * B2;
// 31 %long %real b23 = s * b2 + t * b3
double B23 = __builtin_nan("");
B23 = S * B2 + T * B3;
// 32 %long %real b012 = s * b01 + t * b12
double B012 = __builtin_nan("");
B012 = S * B01 + T * B12;
// 33 %long %real b123 = s * b12 + t * b23
double B123 = __builtin_nan("");
B123 = S * B12 + T * B23;
// 34 %result = s * b012 + t * b123
_imp_result(S * B012 + T * B123);
// 35 %end
_imp_begin_backtrace(EVALBERN3);
_imp_diagf("\n\nArguments:\n\n");
if (__builtin_isnan(B0))
_imp_diagf("B0 = <UNASSIGNED REAL>\n");
else
_imp_diagf("B0 = %LE\n", (long double)B0);
if (__builtin_isnan(B1))
_imp_diagf("B1 = <UNASSIGNED REAL>\n");
else
_imp_diagf("B1 = %LE\n", (long double)B1);
if (__builtin_isnan(B2))
_imp_diagf("B2 = <UNASSIGNED REAL>\n");
else
_imp_diagf("B2 = %LE\n", (long double)B2);
if (__builtin_isnan(B3))
_imp_diagf("B3 = <UNASSIGNED REAL>\n");
else
_imp_diagf("B3 = %LE\n", (long double)B3);
if (__builtin_isnan(T))
_imp_diagf("T = <UNASSIGNED REAL>\n");
else
_imp_diagf("T = %LE\n", (long double)T);
_imp_diagf("\nLocal Variables:\n\n");
_imp_bt_real(S);
_imp_bt_real(B01);
_imp_bt_real(B12);
_imp_bt_real(B23);
_imp_bt_real(B012);
_imp_bt_real(B123);
_imp_end_backtrace();
} /* end of EVALBERN3 */
// 36
// 37 %routine bern2to3(%long %real q0, %long %real q1, %long %real q2, %long %real %name c0, %long %real %name c1, %long %real %name c2, %long %real %name c3)
void BERN2TO3(double Q0, double Q1, double Q2, double *C0, double *C1, double *C2, double *C3) {
_imp_enter(BERN2TO3);
// 38 c0 = q0
*C0 = Q0;
// 39 c1 = q0 / 3 + q1 * 2/3
*C1 = (double)(Q0 / 3) + (double)((Q1 * 2) / 3);
// 40 c2 = q1 * 2/3 + q2 / 3
*C2 = (double)((Q1 * 2) / 3) + (double)(Q2 / 3);
// 41 c3 = q2
*C3 = Q2;
// 42 %end
_imp_return;
_imp_begin_backtrace(BERN2TO3);
_imp_diagf("\n\nArguments:\n\n");
if (__builtin_isnan(Q0))
_imp_diagf("Q0 = <UNASSIGNED REAL>\n");
else
_imp_diagf("Q0 = %LE\n", (long double)Q0);
if (__builtin_isnan(Q1))
_imp_diagf("Q1 = <UNASSIGNED REAL>\n");
else
_imp_diagf("Q1 = %LE\n", (long double)Q1);
if (__builtin_isnan(Q2))
_imp_diagf("Q2 = <UNASSIGNED REAL>\n");
else
_imp_diagf("Q2 = %LE\n", (long double)Q2);
_imp_diagf("C0 = %LE\n", (long double)*C0);
_imp_diagf("C1 = %LE\n", (long double)*C1);
_imp_diagf("C2 = %LE\n", (long double)*C2);
_imp_diagf("C3 = %LE\n", (long double)*C3);
_imp_diagf("\nLocal Variables:\n\n");
_imp_end_backtrace();
} /* end of BERN2TO3 */
// 43
// 44 { uses Horner's rule }
// 45 %long %real %fn evalmono2(%long %real a0, %long %real a1, %long %real a2, %long %real t)
double EVALMONO2(double A0, double A1, double A2, double T) {
_imp_enter(EVALMONO2);
// 46 %result = a0 + (t * (a1 + (t * a2)))
_imp_result(A0 + T * (A1 + T * A2));
// 47 %end
_imp_begin_backtrace(EVALMONO2);
_imp_diagf("\n\nArguments:\n\n");
if (__builtin_isnan(A0))
_imp_diagf("A0 = <UNASSIGNED REAL>\n");
else
_imp_diagf("A0 = %LE\n", (long double)A0);
if (__builtin_isnan(A1))
_imp_diagf("A1 = <UNASSIGNED REAL>\n");
else
_imp_diagf("A1 = %LE\n", (long double)A1);
if (__builtin_isnan(A2))
_imp_diagf("A2 = <UNASSIGNED REAL>\n");
else
_imp_diagf("A2 = %LE\n", (long double)A2);
if (__builtin_isnan(T))
_imp_diagf("T = <UNASSIGNED REAL>\n");
else
_imp_diagf("T = %LE\n", (long double)T);
_imp_diagf("\nLocal Variables:\n\n");
_imp_end_backtrace();
} /* end of EVALMONO2 */
// 48
// 49 { uses Horner's rule }
// 50 %long %real %fn evalmono3(%long %real a0, %long %real a1, %long %real a2, %long %real a3, %long %real t)
double EVALMONO3(double A0, double A1, double A2, double A3, double T) {
_imp_enter(EVALMONO3);
// 51 %result = a0 + (t * (a1 + (t * (a2 + (t * a3)))))
_imp_result(A0 + T * (A1 + T * (A2 + T * A3)));
// 52 %end
_imp_begin_backtrace(EVALMONO3);
_imp_diagf("\n\nArguments:\n\n");
if (__builtin_isnan(A0))
_imp_diagf("A0 = <UNASSIGNED REAL>\n");
else
_imp_diagf("A0 = %LE\n", (long double)A0);
if (__builtin_isnan(A1))
_imp_diagf("A1 = <UNASSIGNED REAL>\n");
else
_imp_diagf("A1 = %LE\n", (long double)A1);
if (__builtin_isnan(A2))
_imp_diagf("A2 = <UNASSIGNED REAL>\n");
else
_imp_diagf("A2 = %LE\n", (long double)A2);
if (__builtin_isnan(A3))
_imp_diagf("A3 = <UNASSIGNED REAL>\n");
else
_imp_diagf("A3 = %LE\n", (long double)A3);
if (__builtin_isnan(T))
_imp_diagf("T = <UNASSIGNED REAL>\n");
else
_imp_diagf("T = %LE\n", (long double)T);
_imp_diagf("\nLocal Variables:\n\n");
_imp_end_backtrace();
} /* end of EVALMONO3 */
// 53
// 54 %long %real p0m, p1m, p2m, q0m, q1m, q2m, r0m, r1m, r2m, r3m
double P0M = __builtin_nan("");
double P1M = __builtin_nan("");
double P2M = __builtin_nan("");
double Q0M = __builtin_nan("");
double Q1M = __builtin_nan("");
double Q2M = __builtin_nan("");
double R0M = __builtin_nan("");
double R1M = __builtin_nan("");
double R2M = __builtin_nan("");
double R3M = __builtin_nan("");
// 55 %long %real p0b2, p1b2, p2b2, q0b2, q1b2, q2b2
double P0B2 = __builtin_nan("");
double P1B2 = __builtin_nan("");
double P2B2 = __builtin_nan("");
double Q0B2 = __builtin_nan("");
double Q1B2 = __builtin_nan("");
double Q2B2 = __builtin_nan("");
// 56 %long %real p0b3, p1b3, p2b3, p3b3, q0b3, q1b3, q2b3, q3b3, r0b3, r1b3, r2b3, r3b3
double P0B3 = __builtin_nan("");
double P1B3 = __builtin_nan("");
double P2B3 = __builtin_nan("");
double P3B3 = __builtin_nan("");
double Q0B3 = __builtin_nan("");
double Q1B3 = __builtin_nan("");
double Q2B3 = __builtin_nan("");
double Q3B3 = __builtin_nan("");
double R0B3 = __builtin_nan("");
double R1B3 = __builtin_nan("");
double R2B3 = __builtin_nan("");
double R3B3 = __builtin_nan("");
// 57 %long %real pc0, pc1, pc2, pc3, qc0, qc1, qc2, qc3
double PC0 = __builtin_nan("");
double PC1 = __builtin_nan("");
double PC2 = __builtin_nan("");
double PC3 = __builtin_nan("");
double QC0 = __builtin_nan("");
double QC1 = __builtin_nan("");
double QC2 = __builtin_nan("");
double QC3 = __builtin_nan("");
// 58
// 59 %long %real x, y, m
double X = __builtin_nan("");
double Y = __builtin_nan("");
double M = __builtin_nan("");
// 60
// 61 p0m = 1; p1m = 0; p2m = 0
P0M = 1;
P1M = 0;
P2M = 0;
// 62 q0m = 1; q1m = 2; q2m = 3
Q0M = 1;
Q1M = 2;
Q2M = 3;
// 63 r0m = 1; r1m = 2; r2m = 3; r3m = 4
R0M = 1;
R1M = 2;
R2M = 3;
R3M = 4;
// 64
// 65 tobern2 (p0m, p1m, p2m, p0b2, p1b2, p2b2)
TOBERN2(P0M, P1M, P2M, &P0B2, &P1B2, &P2B2);
// 66 tobern2 (q0m, q1m, q2m, q0b2, q1b2, q2b2)
TOBERN2(Q0M, Q1M, Q2M, &Q0B2, &Q1B2, &Q2B2);
// 67 print string ("Subprogram (1) examples:".snl)
_imp_printf("%s%S", "Subprogram (1) examples:", _imp_strp(SNL));
// 68 print string (" mono ( ")
_imp_printf("%s", " mono ( ");
// 69 print fl (p0m, 4); print string (", ")
_imp_PRINTFL(P0M, 4);
_imp_printf("%s", ", ");
// 70 print fl (p1m, 4); print string (", ")
_imp_PRINTFL(P1M, 4);
_imp_printf("%s", ", ");
// 71 print fl (p2m, 4); print string (") --> bern ( ")
_imp_PRINTFL(P2M, 4);
_imp_printf("%s", ") --> bern ( ");
// 72 print fl (p0b2, 4); print string (", ")
_imp_PRINTFL(P0B2, 4);
_imp_printf("%s", ", ");
// 73 print fl (p1b2, 4); print string (", ")
_imp_PRINTFL(P1B2, 4);
_imp_printf("%s", ", ");
// 74 print fl (p2b2, 4); print string (")".snl)
_imp_PRINTFL(P2B2, 4);
_imp_printf("%s%S", ")", _imp_strp(SNL));
// 75 print string (" mono ( ")
_imp_printf("%s", " mono ( ");
// 76 print fl (q0m, 4); print string (", ")
_imp_PRINTFL(Q0M, 4);
_imp_printf("%s", ", ");
// 77 print fl (q1m, 4); print string (", ")
_imp_PRINTFL(Q1M, 4);
_imp_printf("%s", ", ");
// 78 print fl (q2m, 4); print string (") --> bern ( ")
_imp_PRINTFL(Q2M, 4);
_imp_printf("%s", ") --> bern ( ");
// 79 print fl (q0b2, 4); print string (", ")
_imp_PRINTFL(Q0B2, 4);
_imp_printf("%s", ", ");
// 80 print fl (q1b2, 4); print string (", ")
_imp_PRINTFL(Q1B2, 4);
_imp_printf("%s", ", ");
// 81 print fl (q2b2, 4); print string (")".snl)
_imp_PRINTFL(Q2B2, 4);
_imp_printf("%s%S", ")", _imp_strp(SNL));
// 82
// 83 print string ("Subprogram (2) examples:".snl)
_imp_printf("%s%S", "Subprogram (2) examples:", _imp_strp(SNL));
// 84 x = 0.25
X = 0.25;
// 85 y = evalbern2 (p0b2, p1b2, p2b2, x)
Y = EVALBERN2(P0B2, P1B2, P2B2, X);
// 86 print string (" p ( "); print fl (x, 4)
_imp_printf("%s", " p ( ");
_imp_PRINTFL(X, 4);
// 87 print string (") = "); print fl (y, 4)
_imp_printf("%s", ") = ");
_imp_PRINTFL(Y, 4);
// 88 newline
_imp_NEWLINE();
// 89 x = 7.50
X = 7.50;
// 90 y = evalbern2 (p0b2, p1b2, p2b2, x)
Y = EVALBERN2(P0B2, P1B2, P2B2, X);
// 91 print string (" p ( "); print fl (x, 4)
_imp_printf("%s", " p ( ");
_imp_PRINTFL(X, 4);
// 92 print string (") = "); print fl (y, 4)
_imp_printf("%s", ") = ");
_imp_PRINTFL(Y, 4);
// 93 newline
_imp_NEWLINE();
// 94 x = 0.25
X = 0.25;
// 95 y = evalbern2 (q0b2, q1b2, q2b2, x)
Y = EVALBERN2(Q0B2, Q1B2, Q2B2, X);
// 96 print string (" q ( "); print fl (x, 4)
_imp_printf("%s", " q ( ");
_imp_PRINTFL(X, 4);
// 97 print string (") = "); print fl (y, 4)
_imp_printf("%s", ") = ");
_imp_PRINTFL(Y, 4);
// 98 newline
_imp_NEWLINE();
// 99 x = 7.50
X = 7.50;
// 100 y = evalbern2 (q0b2, q1b2, q2b2, x)
Y = EVALBERN2(Q0B2, Q1B2, Q2B2, X);
// 101 print string (" q ( "); print fl (x, 4)
_imp_printf("%s", " q ( ");
_imp_PRINTFL(X, 4);
// 102 print string (") = "); print fl (y, 4)
_imp_printf("%s", ") = ");
_imp_PRINTFL(Y, 4);
// 103 newline
_imp_NEWLINE();
// 104
// 105 tobern3 (p0m, p1m, p2m, 0, p0b3, p1b3, p2b3, p3b3)
TOBERN3(P0M, P1M, P2M, 0, &P0B3, &P1B3, &P2B3, &P3B3);
// 106 tobern3 (q0m, q1m, q2m, 0, q0b3, q1b3, q2b3, q3b3)
TOBERN3(Q0M, Q1M, Q2M, 0, &Q0B3, &Q1B3, &Q2B3, &Q3B3);
// 107 tobern3 (r0m, r1m, r2m, r3m, r0b3, r1b3, r2b3, r3b3)
TOBERN3(R0M, R1M, R2M, R3M, &R0B3, &R1B3, &R2B3, &R3B3);
// 108 print string ("Subprogram (3) examples:".snl)
_imp_printf("%s%S", "Subprogram (3) examples:", _imp_strp(SNL));
// 109 print string (" mono ( ")
_imp_printf("%s", " mono ( ");
// 110 print fl (p0m, 4); print string (", ")
_imp_PRINTFL(P0M, 4);
_imp_printf("%s", ", ");
// 111 print fl (p1m, 4); print string (", ")
_imp_PRINTFL(P1M, 4);
_imp_printf("%s", ", ");
// 112 print fl (p2m, 4); print string (", ")
_imp_PRINTFL(P2M, 4);
_imp_printf("%s", ", ");
// 113 print fl (0, 4); print string (") --> bern ( ")
_imp_PRINTFL(0, 4);
_imp_printf("%s", ") --> bern ( ");
// 114 print fl (p0b3, 4); print string (", ")
_imp_PRINTFL(P0B3, 4);
_imp_printf("%s", ", ");
// 115 print fl (p1b3, 4); print string (", ")
_imp_PRINTFL(P1B3, 4);
_imp_printf("%s", ", ");
// 116 print fl (p2b3, 4); print string (", ")
_imp_PRINTFL(P2B3, 4);
_imp_printf("%s", ", ");
// 117 print fl (p3b3, 4); print string (")".snl)
_imp_PRINTFL(P3B3, 4);
_imp_printf("%s%S", ")", _imp_strp(SNL));
// 118 print string (" mono ( ")
_imp_printf("%s", " mono ( ");
// 119 print fl (q0m, 4); print string (", ")
_imp_PRINTFL(Q0M, 4);
_imp_printf("%s", ", ");
// 120 print fl (q1m, 4); print string (", ")
_imp_PRINTFL(Q1M, 4);
_imp_printf("%s", ", ");
// 121 print fl (q2m, 4); print string (", ")
_imp_PRINTFL(Q2M, 4);
_imp_printf("%s", ", ");
// 122 print fl (0, 4); print string (") --> bern ( ")
_imp_PRINTFL(0, 4);
_imp_printf("%s", ") --> bern ( ");
// 123 print fl (q0b3, 4); print string (", ")
_imp_PRINTFL(Q0B3, 4);
_imp_printf("%s", ", ");
// 124 print fl (q1b3, 4); print string (", ")
_imp_PRINTFL(Q1B3, 4);
_imp_printf("%s", ", ");
// 125 print fl (q2b3, 4); print string (", ")
_imp_PRINTFL(Q2B3, 4);
_imp_printf("%s", ", ");
// 126 print fl (q3b3, 4); print string (")".snl)
_imp_PRINTFL(Q3B3, 4);
_imp_printf("%s%S", ")", _imp_strp(SNL));
// 127 print string (" mono ( ")
_imp_printf("%s", " mono ( ");
// 128 print fl (r0m, 4); print string (", ")
_imp_PRINTFL(R0M, 4);
_imp_printf("%s", ", ");
// 129 print fl (r1m, 4); print string (", ")
_imp_PRINTFL(R1M, 4);
_imp_printf("%s", ", ");
// 130 print fl (r2m, 4); print string (", ")
_imp_PRINTFL(R2M, 4);
_imp_printf("%s", ", ");
// 131 print fl (r3m, 4); print string (") --> bern ( ")
_imp_PRINTFL(R3M, 4);
_imp_printf("%s", ") --> bern ( ");
// 132 print fl (r0b3, 4); print string (", ")
_imp_PRINTFL(R0B3, 4);
_imp_printf("%s", ", ");
// 133 print fl (r1b3, 4); print string (", ")
_imp_PRINTFL(R1B3, 4);
_imp_printf("%s", ", ");
// 134 print fl (r2b3, 4); print string (", ")
_imp_PRINTFL(R2B3, 4);
_imp_printf("%s", ", ");
// 135 print fl (r3b3, 4); print string (")".snl)
_imp_PRINTFL(R3B3, 4);
_imp_printf("%s%S", ")", _imp_strp(SNL));
// 136
// 137 print string ("Subprogram (4) examples:".snl)
_imp_printf("%s%S", "Subprogram (4) examples:", _imp_strp(SNL));
// 138 x = 0.25
X = 0.25;
// 139 y = evalbern3 (p0b3, p1b3, p2b3, p3b3, x)
Y = EVALBERN3(P0B3, P1B3, P2B3, P3B3, X);
// 140 print string (" p ( "); print fl (x, 4)
_imp_printf("%s", " p ( ");
_imp_PRINTFL(X, 4);
// 141 print string (") = "); print fl (y, 4)
_imp_printf("%s", ") = ");
_imp_PRINTFL(Y, 4);
// 142 newline
_imp_NEWLINE();
// 143 x = 7.50
X = 7.50;
// 144 y = evalbern3 (p0b3, p1b3, p2b3, p3b3, x)
Y = EVALBERN3(P0B3, P1B3, P2B3, P3B3, X);
// 145 print string (" p ( "); print fl (x, 4)
_imp_printf("%s", " p ( ");
_imp_PRINTFL(X, 4);
// 146 print string (") = "); print fl (y, 4)
_imp_printf("%s", ") = ");
_imp_PRINTFL(Y, 4);
// 147 newline
_imp_NEWLINE();
// 148 x = 0.25
X = 0.25;
// 149 y = evalbern3 (q0b3, q1b3, q2b3, q3b3, x)
Y = EVALBERN3(Q0B3, Q1B3, Q2B3, Q3B3, X);
// 150 print string (" q ( "); print fl (x, 4)
_imp_printf("%s", " q ( ");
_imp_PRINTFL(X, 4);
// 151 print string (") = "); print fl (y, 4)
_imp_printf("%s", ") = ");
_imp_PRINTFL(Y, 4);
// 152 newline
_imp_NEWLINE();
// 153 x = 7.50
X = 7.50;
// 154 y = evalbern3 (q0b3, q1b3, q2b3, q3b3, x)
Y = EVALBERN3(Q0B3, Q1B3, Q2B3, Q3B3, X);
// 155 print string (" q ( "); print fl (x, 4)
_imp_printf("%s", " q ( ");
_imp_PRINTFL(X, 4);
// 156 print string (") = "); print fl (y, 4)
_imp_printf("%s", ") = ");
_imp_PRINTFL(Y, 4);
// 157 newline
_imp_NEWLINE();
// 158 x = 0.25
X = 0.25;
// 159 y = evalbern3 (r0b3, r1b3, r2b3, r3b3, x)
Y = EVALBERN3(R0B3, R1B3, R2B3, R3B3, X);
// 160 print string (" r ( "); print fl (x, 4)
_imp_printf("%s", " r ( ");
_imp_PRINTFL(X, 4);
// 161 print string (") = "); print fl (y, 4)
_imp_printf("%s", ") = ");
_imp_PRINTFL(Y, 4);
// 162 newline
_imp_NEWLINE();
// 163 x = 7.50
X = 7.50;
// 164 y = evalbern3 (r0b3, r1b3, r2b3, r3b3, x)
Y = EVALBERN3(R0B3, R1B3, R2B3, R3B3, X);
// 165 print string (" r ( "); print fl (x, 4)
_imp_printf("%s", " r ( ");
_imp_PRINTFL(X, 4);
// 166 print string (") = "); print fl (y, 4)
_imp_printf("%s", ") = ");
_imp_PRINTFL(Y, 4);
// 167 newline
_imp_NEWLINE();
// 168
// 169 bern2to3 (p0b2, p1b2, p2b2, pc0, pc1, pc2, pc3)
BERN2TO3(P0B2, P1B2, P2B2, &PC0, &PC1, &PC2, &PC3);
// 170 bern2to3 (q0b2, q1b2, q2b2, qc0, qc1, qc2, qc3)
BERN2TO3(Q0B2, Q1B2, Q2B2, &QC0, &QC1, &QC2, &QC3);
// 171 print string ("Subprogram (5) examples:".snl)
_imp_printf("%s%S", "Subprogram (5) examples:", _imp_strp(SNL));
// 172 print string (" bern ( ")
_imp_printf("%s", " bern ( ");
// 173 print fl (p0b2, 4); print string (", ")
_imp_PRINTFL(P0B2, 4);
_imp_printf("%s", ", ");
// 174 print fl (p1b2, 4); print string (", ")
_imp_PRINTFL(P1B2, 4);
_imp_printf("%s", ", ");
// 175 print fl (p2b2, 4); print string (") --> bern ( ")
_imp_PRINTFL(P2B2, 4);
_imp_printf("%s", ") --> bern ( ");
// 176 print fl (pc0, 4); print string (", ")
_imp_PRINTFL(PC0, 4);
_imp_printf("%s", ", ");
// 177 print fl (pc1, 4); print string (", ")
_imp_PRINTFL(PC1, 4);
_imp_printf("%s", ", ");
// 178 print fl (pc2, 4); print string (", ")
_imp_PRINTFL(PC2, 4);
_imp_printf("%s", ", ");
// 179 print fl (pc3, 4); print string (")".snl)
_imp_PRINTFL(PC3, 4);
_imp_printf("%s%S", ")", _imp_strp(SNL));
// 180 print string (" bern ( ")
_imp_printf("%s", " bern ( ");
// 181 print fl (q0b2, 4); print string (", ")
_imp_PRINTFL(Q0B2, 4);
_imp_printf("%s", ", ");
// 182 print fl (q1b2, 4); print string (", ")
_imp_PRINTFL(Q1B2, 4);
_imp_printf("%s", ", ");
// 183 print fl (q2b2, 4); print string (") --> bern ( ")
_imp_PRINTFL(Q2B2, 4);
_imp_printf("%s", ") --> bern ( ");
// 184 print fl (qc0, 4); print string (", ")
_imp_PRINTFL(QC0, 4);
_imp_printf("%s", ", ");
// 185 print fl (qc1, 4); print string (", ")
_imp_PRINTFL(QC1, 4);
_imp_printf("%s", ", ");
// 186 print fl (qc2, 4); print string (", ")
_imp_PRINTFL(QC2, 4);
_imp_printf("%s", ", ");
// 187 print fl (qc3, 4); print string (")".snl)
_imp_PRINTFL(QC3, 4);
_imp_printf("%s%S", ")", _imp_strp(SNL));
// 188 %endofprogram
_imp_stop(0);
end_0:;
_imp_begin_backtrace(main);
_imp_diagf("\n\nArguments:\n\n");
_imp_diagf("ARGC = %d\n", argc);
_imp_diagf("ARGV @[%p]\n", argv);
for (int i = 0; i < argc; i++) {
_imp_diagf(" ARGV(%d) = \"%s\"\n", i, argv[i]);
}
if (argv[argc] == 0) {
_imp_diagf(" ARGV(%d) = NULL\n", argc);
} else {
_imp_diagf(" ARGV(%d) = \"%s\"\n", argc, argv[argc]);
}
_imp_diagf("\nLocal Variables:\n\n");
_imp_diagf("SNL = \"%.*s\"\n", SNL.cstr.len, SNL.cstr.s);
_imp_bt_real(P0M);
_imp_bt_real(P1M);
_imp_bt_real(P2M);
_imp_bt_real(Q0M);
_imp_bt_real(Q1M);
_imp_bt_real(Q2M);
_imp_bt_real(R0M);
_imp_bt_real(R1M);
_imp_bt_real(R2M);
_imp_bt_real(R3M);
_imp_bt_real(P0B2);
_imp_bt_real(P1B2);
_imp_bt_real(P2B2);
_imp_bt_real(Q0B2);
_imp_bt_real(Q1B2);
_imp_bt_real(Q2B2);
_imp_bt_real(P0B3);
_imp_bt_real(P1B3);
_imp_bt_real(P2B3);
_imp_bt_real(P3B3);
_imp_bt_real(Q0B3);
_imp_bt_real(Q1B3);
_imp_bt_real(Q2B3);
_imp_bt_real(Q3B3);
_imp_bt_real(R0B3);
_imp_bt_real(R1B3);
_imp_bt_real(R2B3);
_imp_bt_real(R3B3);
_imp_bt_real(PC0);
_imp_bt_real(PC1);
_imp_bt_real(PC2);
_imp_bt_real(PC3);
_imp_bt_real(QC0);
_imp_bt_real(QC1);
_imp_bt_real(QC2);
_imp_bt_real(QC3);
_imp_bt_real(X);
_imp_bt_real(Y);
_imp_bt_real(M);
_imp_end_backtrace();
_imp_stop(0);
}