-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy patht.q
282 lines (282 loc) · 9.34 KB
/
t.q
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
+ 1 +- 0.0 | 0.5 .5
+ 1. +- 0.0 | 0.5 0.5
+ 2.0 +- 0.0 | 1.0 1.0
+ 0.0 +- 0.0 | 1.0 -1.0
+ 3.3 +- 0.0 | 1.1 2.2
+ 4.0 +- 0.0 | 2.0 2.0
+ -0.1 +- 0.0001 | 0.4 -0.5
/ 4.5 +- 0.0 | 9.0 2.0
/ 3.0 +- 0.0 | 9.0 3.0
/ 0.5 +- 0.0 | 1.0 2.0
/ 4.8 +- 0.0001 | 2.4 0.5
/ -4.8 +- 0.0001 | -2.4 0.5
rem 1.0 +- 0.0001 | 7.0 2.0
rem 0.0 +- 0.0001 | 7.0 3.5
rem 2.0 +- 0.0001 | 8.0 3.0
rem 1.4 +- 0.0001 | 8.0 3.3
rem 1.4 +- 0.0001 | 8.0 -3.3
rem -1.4 +- 0.0001 | -8.0 -3.3
mod 1.0 +- 0.0001 | 7.0 2.0
mod 0.0 +- 0.0001 | 7.0 3.5
mod 2.0 +- 0.0001 | 8.0 3.0
mod 1.4 +- 0.0001 | 8.0 3.3
mod -1.0 +- 0.0001 | 8.0 -3.0
mod -2.0 +- 0.0001 | -8.0 -3.0
* -2.5 +- 0.0 | 1.25 -2.0
* 0.0 +- 0.0 | 5.0 0.0
* 0.0 +- 0.0 | 0.0 2.0
* 1.1 +- 0.0 | 1.1 1.0
> 1.0 +- 0.0 | 4.0 3.0
> 1.0 +- 0.0 | -3.1 -4.2
> 1.0 +- 0.0 | 0.0 -9.0
> 0.0 +- 0.0 | 0.0 -0.0
< 0.0 +- 0.0 | 0.0 -9.0
== 1.0 +- 0.0 | 0.0 0.000
== 0.0 +- 0.0 | 0.0 0.0002
min 97.0 +- 0.0 | 97.0 99.0
max 99.0 +- 0.0 | 97.0 99.0
min -123.4 +- 0.0 | 0.0 -123.4
max -123.4 +- 0.0 | -999.0 -123.4
negate 4.5 +- 1.0 | -5.0
negate 0.0 +- 0.0 | 0.0
sin 0.0 +- 0.02 | 3.14159
sin 0.841 +- 0.02 | 1.0
atan 0.785 +- 0.02 | 1.0
atan 1.560 +- 0.02 | 100.0
cos -1.0 +- 0.02 | 3.14159
tan 1.557 +- 0.02 | 1.
tan 0.0 +- 0.02 | 0.
cot 0.6421 +- 0.02 | 1.
abs 4.2 +- 0.0001 | 4.2
abs 4.2 +- 0.0001 | -4.2
even? 0.0 +- 0.0 | 3.0
even? 0.0 +- 0.0 | 3.3
even? 1.0 +- 0.0 | 2.0
even? 0.0 +- 0.0 | 2.1
even? 1.0 +- 0.0 | -2.0
even? 0.0 +- 0.0 | -2.1
even? 0.0 +- 0.0 | -3.0
int? 1.0 +- 0.0 | 0.0
int? 1.0 +- 0.0 | 5.0
int? 0.0 +- 0.0 | 5.4
int? 0.0 +- 0.0 | -5.4
odd? 1.0 +- 0.0 | 3.0
odd? 0.0 +- 0.0 | 3.3
odd? 0.0 +- 0.0 | 2.0
odd? 0.0 +- 0.0 | 2.1
odd? 0.0 +- 0.0 | -2.0
odd? 1.0 +- 0.0 | -3.0
odd? 0.0 +- 0.0 | -2.1
neg? 1.0 +- 0.0 | -1.0
neg? 0.0 +- 0.0 | 1.0
neg? 0.0 +- 0.0 | 0.0
pos? 0.0 +- 0.0 | -1.0
pos? 1.0 +- 0.0 | 0.0
floor 3.0 +- 0.0 | 3.0
floor -3.0 +- 0.0 | -3.0
floor 2.0 +- 0.0 | 2.3
floor 3.0 +- 0.0 | 3.8
floor 5.0 +- 0.0 | 5.5
floor -3.0 +- 0.0 | -2.3
floor -4.0 +- 0.0 | -3.8
floor -6.0 +- 0.0 | -5.5
trunc 3.0 +- 0.0 | 3.0
trunc -3.0 +- 0.0 | -3.0
trunc 2.0 +- 0.0 | 2.3
trunc 3.0 +- 0.0 | 3.8
trunc 5.0 +- 0.0 | 5.5
trunc -2.0 +- 0.0 | -2.3
trunc -3.0 +- 0.0 | -3.8
trunc -5.0 +- 0.0 | -5.5
ceil 3.0 +- 0.0 | 3.0
ceil -3.0 +- 0.0 | -3.0
ceil 3.0 +- 0.0 | 2.3
ceil 4.0 +- 0.0 | 3.8
ceil 6.0 +- 0.0 | 5.5
ceil -2.0 +- 0.0 | -2.3
ceil -3.0 +- 0.0 | -3.8
ceil -5.0 +- 0.0 | -5.5
round 3.0 +- 0.0 | 3.0
round -3.0 +- 0.0 | -3.0
round 2.0 +- 0.0 | 2.3
round 4.0 +- 0.0 | 3.8
round 6.0 +- 0.0 | 5.5
round -2.0 +- 0.0 | -2.3
round -4.0 +- 0.0 | -3.8
round -6.0 +- 0.0 | -5.5
arshift 0.5 +- 0.0 | 1.0 1
arshift -1.0 +- 0.0 | -2.0 1
copysign -2.3 +- 0.0 | 2.3 -999
copysign -2.3 +- 0.0 | -2.3 -2.3
copysign 2.3 +- 0.0 | 2.3 4.1
copysign 2.3 +- 0.0 | -2.3 3.0
# '_mul' and '_div' use CORDIC to do division and multiplication
# They only work over a limited range and need more work as
# they do not give correct results for all sign combinations
_mul 0.0 +- 0.02 | 0.0 0.0
_mul 0.0 +- 0.02 | 1.0 0.0
_mul 0.0 +- 0.02 | 0.0 1.0
_mul 1.0 +- 0.02 | 1.0 1.0
_mul 2.25 +- 0.02 | 1.5 1.5
_mul 0.268 +- 0.02 | 0.67 0.4
_mul 4.0 +- 0.02 | 2.0 2.0
_mul 3.1 +- 0.02 | 1.76 1.76
_mul 3.1 +- 0.02 | 1.76 1.76
_mul 2.73 +- 0.02 | 2.1 1.3
_div 1.0 +- 0.02 | 2.0 2.0
_div 1.0 +- 0.02 | 4.0 4.0
_div 2.0 +- 0.02 | 4.0 2.0
_div 0.5 +- 0.02 | 0.5 1.0
_div 2.0 +- 0.02 | 1.0 0.5
_mul -4.0 +- 0.02 | 2.0 -2.0
# _mul 9.0 +- 0.02 | 3.0 3.0
_mul 4.0 +- 0.02 | -2.0 -2.0
_mul -4.0 +- 0.02 | -2.0 2.0
_mul 4.0 +- 0.02 | -2.0 -2.0
# These Hyperbolic functions works for small values only
sinh 1.175 +- 0.02 | 1.0
sinh 0.521 +- 0.02 | 0.5
cosh 1.543 +- 0.02 | 1.0
cosh 1.127 +- 0.02 | 0.5
tanh 0.761 +- 0.02 | 1.0
tanh 0.462 +- 0.02 | 0.5
tanh -0.761 +- 0.02 | -1.0
# Square root over a limited range " ~0 < x 2"
_sqrt 0.0 +- 0.10 | 0.0
_sqrt 1.414 +- 0.02 | 2.0
_sqrt 1.0 +- 0.02 | 1.0
_sqrt 0.707 +- 0.02 | 0.5
_exp 1.000 +- 0.02 | 0.0
_exp 2.718 +- 0.02 | 1.0
_exp 3.004 +- 0.02 | 1.1
exp 1.000 +- 0.02 | 0.0
exp 2.718 +- 0.02 | 1.0
exp 3.004 +- 0.02 | 1.1
exp 20.085 +- 0.02 | 3.0
exp 33.115 +- 0.02 | 3.5
exp 0.367 +- 0.02 | -1.0
exp 1.649 +- 0.02 | 0.5
# NB. Larger error!
exp 2980.957 +- 1.20 | 8.0
exp 22026.466 +- 25.0 | 10.0
# NB. Saturation!
exp 32767.9999 +- 0.01 | 12.0
# Exp fails for large values > ~9
# _exp 20.085 +- 0.02 | 3.0
_ln 0.0 +- 0.02 | 1.0
_ln 1.0 +- 0.02 | 2.7183
_ln 2.0 +- 0.02 | 7.3891
_ln 2.0794 +- 0.02 | 8.0
# Error too high/goes wrong for large values
# _ln 2.302 +- 0.02 | 10.0
# _ln 3.0 +- 0.02 | 20.086
hypot 1.414 +- 0.02 | 1.0 1.0
hypot 2.236 +- 0.02 | 1.0 2.0
hypot 5.000 +- 0.02 | 3.0 4.0
hypot 14.14 +- 0.02 | 10.0 10.0
hypot 14.14 +- 0.02 | -10.0 10.0 # NB!
hypot 141.4 +- 0.02 | 100.0 100.0
hypot 141.4 +- 0.02 | 100.0 100.0
hypot 20.22 +- 0.02 | 20.0 -3.0
log -1.0 +- 0.02 | 0.3679
log 0.5 +- 0.02 | 1.6487
log 1.0 +- 0.02 | 2.7182
log 2.0 +- 0.02 | 7.3891
log 3.0 +- 0.02 | 20.0866
log 3.5 +- 0.02 | 33.1154
log 4.0 +- 0.02 | 54.5981
log 8.0 +- 0.02 | 2980.9580
rad2deg 0 +- 0.02 | 0
rad2deg 360 +- 0.02 | 6.2832
rad2deg 180 +- 0.02 | 3.1416
rad2deg 90 +- 0.02 | 1.5708
rad2deg -90 +- 0.02 | -1.5708
deg2rad 6.2832 +- 0.02 | 360
deg2rad -6.2832 +- 0.02 | -360
deg2rad 3.1416 +- 0.02 | 180
deg2rad 1.5708 +- 0.02 | 90
deg2rad 0 +- 0.02 | 0
sqrt 0 +- 0.02 | 0
sqrt 0.03162 +- 0.02 | 0.001
sqrt 2.0 +- 0.02 | 4.0
sqrt 0.7071 +- 0.02 | 0.5
sqrt 10.0 +- 0.02 | 100
sqrt 10.04988 +- 0.02 | 101
sqrt 0.03162 +- 0.02 | 0.001
sqrt 10.0 +- 0.02 | 99.9999
sqrt 100 +- 0.02 | 10000.0000
sqrt 141.4213 +- 0.02 | 20000.0000
sqrt 173.2050 +- 0.01 | 30000.0000
sqrt 178.8854 +- 0.01 | 32000.0000
sqrt 181.0193 +- 0.01 | 32767.9999
sign 1 +- 0 | 0
sign 1 +- 0 | 1.3
sign 1 +- 0 | 32767.9999
sign -1 +- 0 | -32767.9999
sign -1 +- 0 | -1.0
sign -1 +- 0 | -0.1
signum 0 +- 0 | 0
signum 1 +- 0 | 1.3
signum 1 +- 0 | 32767.9999
signum -1 +- 0 | -32767.9999
signum -1 +- 0 | -1.0
signum -1 +- 0 | -0.1
pow 8 +- 0.02 | 2 3
pow 9 +- 0.02 | 3 2
pow 3 +- 0.02 | 9 0.5
pow 9801 +- 3.00 | 99 2
pow 25 +- 0.02 | 5 2
pow 16 +- 0.02 | 2 4
pow 942.19 +- 0.2 | 8.5 3.2
pow 2 +- 0.02 | 16 0.25
pow 0.5 +- 0.02 | 2 -1
pow 0.25 +- 0.02 | 4 -1
pow 0.125 +- 0.02 | 8 -1
pow -27 +- 0.02 | -3 3
# 'pow' should return complex numbers for negative bases with
# non-integer exponents, this 'pow' cannot do that.
pow 1 +- 0.02 | 0 3
pow 1 +- 0.02 | 0 3.5
pow 0.0625 +- 0.02 | 16 -1
# Error becomes too high for small numbers
# pow 0.01 +- 0.02 | 0.1 2
asin 0.5235 +- 0.02 | .5
asin -0.5235 +- 0.02 | -.5
asin -1.1197 +- 0.02 | -.9
acos 1.5707 +- 0.02 | 0.0
acos 1.0471 +- 0.02 | 0.5
acos 0.4510 +- 0.02 | 0.9
acos 2.0943 +- 0.02 | -0.5
acos 0.0 +- 0.02 | 1.0
acos 3.1415 +- 0.02 | -1.0
# does not work -> atan2 0.78539 +- 0.02 | 0.5 0.5
atan2 0.7853 +- 0.02 | 0.5 0.5
atan2 1.10714 +- 0.02 | 2.0 1.0
atan2 1.5707 +- 0.02 | 1. 0.
atan2 -1.5707 +- 0.02 | -1. 0.
atan2 2.6779 +- 0.02 | 0.5 -1.
# Setting the I/O base!
base 16.0000 +- 0.02 | 16.00
+ A.0000 +- 0.00 | 9.0 1.0
+ 10.0000 +- 0.00 | 1.0 F.0
base A.0 +- 0.0 | A.0
# Error in I/O (probably input) causes extra digits to
# result in wildly incorrect number (2.71719 becomes
# 2.0171). This doesn't have anything to do with the
# operator, just the numeric I/O, this is to test that
# this works.
+ 2.7171 +- 0.00 | 2.71719 0.0
asinh 0.8813 +- 0.002 | 1.
asinh 0.0 +- 0.0 | 0.
asinh 0.4812 +- 0.002 | 0.5
asinh -0.4812 +- 0.002 | -0.5
#asinh 7.5999 +- 0.002 | 999
acosh 1.3169 +- 0.002 | 2
acosh 0. +- 0.002 | 1
acosh 0.9624 +- 0.002 | 1.5
acosh 2.9932 +- 0.002 | 10
acosh 5.2982 +- 0.002 | 100
#acosh 7.6009 +- 0.002 | 1000
atanh 0. +- 0.00 | 0.
atanh 0.5493 +- 0.00 | 0.5
atanh -0.5493 +- 0.001 | -0.5