-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.sth
32 lines (28 loc) · 814 Bytes
/
test.sth
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# these functions are unused (and builtins are used instead) since
# they blow up stack because of level of recursion of evaluate_term()s
# etc. when used on large numbers
plus_rec = (\x . (\y .
case y of
0 -> x,
_ -> (succ ((plus_rec x) (pred y)))
end
)),
mult_rec = (\x . (\y .
case y of
0 -> x,
_ -> ((plus_rec ((mult_rec x) (pred y))) x)
end
)),
m2n a b = mult a b,
m2c a b = ((mult a) b),
m3n a b c = mult (mult a b) c,
m3c a b c = ((mult ((mult a) b)) c),
m4n a b c d = mult (mult (mult a b) c) d,
m4c a b c d = ((mult ((mult ((mult a) b)) c)) d),
two = 2,
sin_alias = sin,
double = (mult two),
mult3 x y z = ((mult ((mult x) y)) z),
mult2pi2 = (m3n (double pi)),
simple f t = (sin_alias ((mult2pi2 f) t)),
simple_release f t = (sin (2 * pi * f * t)) * (exp (-5 * t))