1define t (x,y,d,s,t) {
2   auto u, v, w, i, b, c;
3
4   if (s >= t) {
5     "Bad Scales. Try again.
6";   return;
7   }
8
9   for (i = x; i < y; i += d) {
10     scale = s;
11     u = f(i);
12     scale = t;
13     v = f(i);
14     scale = s;
15     w = v / 1;
16     b += 1;
17     if (u != w) {
18       c += 1;
19"
20Failed:  
21"
22       "  index = "; i;
23       "  val1 = "; u;
24       "  val2 = "; v;
25"
26"
27     }
28   }
29
30"
31Total tests:    "; b;
32"
33Total failures: "; c;
34"
35Percent failed: "; scale = 2; c*100/b;
36
37}
38
39/*
40   b = begining scale value, 
41   l = limit scale value,
42   i = increment scale value.
43
44   if b is set to a non-zero value before this file is executed,
45   b, l and i are not reset.
46*/
47
48if (b == 0) { b = 10; l = 61; i = 10; }
49
50"
51Checking e(x)"
52define f(x) {
53  return (e(x))
54}
55for (s=10; s<l; s=s+i) {
56"
57scale = "; s
58j = t(0,200,1,s,s+4)
59}
60
61"
62Checking l(x)"
63define f(x) {
64  return (l(x))
65}
66for (s=10; s<l; s=s+i) {
67"
68scale = "; s
69j = t(1,10000,25,s,s+4)
70}
71
72"
73Checking s(x)"
74define f(x) {
75  return (s(x))
76}
77for (s=10; s<l; s=s+i) {
78"
79scale = "; s
80j = t(0,8*a(1),.01,s,s+4)
81}
82
83"
84Checking a(x)"
85define f(x) {
86  return (a(x))
87}
88for (s=10; s<l; s=s+i) {
89"
90scale = "; s
91j = t(-1000,1000,10,s,s+4)
92}
93
94"
95Checking j(n,x)"
96define f(x) {
97  return (j(n,x))
98}
99for (s=10; s<l; s=s+i) {
100"
101n=0, scale = "; s
102n=0
103j = t(0,30,.1,s,s+4)
104"
105n=1, scale = "; s
106n=1
107j = t(0,30,.1,s,s+4)
108}
109
110