52 |
(let* ((upper-bound (* 1000 1000 1000 1000)) |
(let* ((upper-bound (* 1000 1000 1000 1000)) |
53 |
(lower-bound (- upper-bound)) |
(lower-bound (- upper-bound)) |
54 |
(spread (1+ (- upper-bound lower-bound)))) |
(spread (1+ (- upper-bound lower-bound)))) |
55 |
(loop for x = (+ (random spread) lower-bound) |
(loop for x = (random-from-interval upper-bound) |
56 |
for y = (+ (random spread) lower-bound) |
for y = (random-from-interval upper-bound) |
57 |
for prod = (* x y) |
for prod = (* x y) |
58 |
for prod2 = (integer-times x y) |
for prod2 = (integer-times x y) |
59 |
repeat 1000 |
repeat 1000 |
93 |
nil) |
nil) |
94 |
|
|
95 |
(deftest *.9 |
(deftest *.9 |
96 |
(let* ((upper-bound (* 1000 1000 1000 1000)) |
(let* ((upper-bound (* 1000 1000 1000 1000))) |
97 |
(lower-bound (- upper-bound)) |
(flet ((%r () (random-from-interval upper-bound))) |
|
(spread (1+ (- upper-bound lower-bound)))) |
|
|
(flet ((%r () (+ (random spread) lower-bound))) |
|
98 |
(loop for xr = (%r) |
(loop for xr = (%r) |
99 |
for xc = (%r) |
for xc = (%r) |
100 |
for x = (complex xr xc) |
for x = (complex xr xc) |
180 |
|
|
181 |
(deftest *.14 |
(deftest *.14 |
182 |
(let ((bound (- (sqrt most-positive-short-float) 1))) |
(let ((bound (- (sqrt most-positive-short-float) 1))) |
183 |
(loop for x = (- (random (* bound 2)) bound) |
(loop for x = (random-from-interval bound) |
184 |
for y = (- (random (* bound 2)) bound) |
for y = (random-from-interval bound) |
185 |
for p = (* x y) |
for p = (* x y) |
186 |
repeat 10000 |
repeat 10000 |
187 |
unless (and (eql p (* y x)) |
unless (and (eql p (* y x)) |
191 |
|
|
192 |
(deftest *.15 |
(deftest *.15 |
193 |
(let ((bound (- (sqrt most-positive-single-float) 1))) |
(let ((bound (- (sqrt most-positive-single-float) 1))) |
194 |
(loop for x = (- (random (* bound 2)) bound) |
(loop for x = (random-from-interval bound) |
195 |
for y = (- (random (* bound 2)) bound) |
for y = (random-from-interval bound) |
196 |
for p = (* x y) |
for p = (* x y) |
197 |
repeat 10000 |
repeat 10000 |
198 |
unless (and (eql p (* y x)) |
unless (and (eql p (* y x)) |
202 |
|
|
203 |
(deftest *.16 |
(deftest *.16 |
204 |
(let ((bound (- (sqrt most-positive-double-float) 1))) |
(let ((bound (- (sqrt most-positive-double-float) 1))) |
205 |
(loop for x = (- (random (* bound 2)) bound) |
(loop for x = (random-from-interval bound) |
206 |
for y = (- (random (* bound 2)) bound) |
for y = (random-from-interval bound) |
207 |
for p = (* x y) |
for p = (* x y) |
208 |
repeat 10000 |
repeat 10000 |
209 |
unless (and (eql p (* y x)) |
unless (and (eql p (* y x)) |
213 |
|
|
214 |
(deftest *.17 |
(deftest *.17 |
215 |
(let ((bound (- (sqrt most-positive-long-float) 1))) |
(let ((bound (- (sqrt most-positive-long-float) 1))) |
216 |
(loop for x = (- (random (* bound 2)) bound) |
(loop for x = (random-from-interval bound) |
217 |
for y = (- (random (* bound 2)) bound) |
for y = (random-from-interval bound) |
218 |
for p = (* x y) |
for p = (* x y) |
219 |
repeat 10000 |
repeat 10000 |
220 |
unless (and (eql p (* y x)) |
unless (and (eql p (* y x)) |
225 |
(deftest *.18 |
(deftest *.18 |
226 |
(let ((bound (- (sqrt most-positive-short-float) 1)) |
(let ((bound (- (sqrt most-positive-short-float) 1)) |
227 |
(bound2 (- (sqrt most-positive-single-float) 1))) |
(bound2 (- (sqrt most-positive-single-float) 1))) |
228 |
(loop for x = (- (random (* bound 2)) bound) |
(loop for x = (random-from-interval bound) |
229 |
for y = (- (random (* bound2 2)) bound2) |
for y = (random-from-interval bound2) |
230 |
for p = (* x y) |
for p = (* x y) |
231 |
repeat 10000 |
repeat 10000 |
232 |
unless (and (eql p (* y x)) |
unless (and (eql p (* y x)) |
237 |
(deftest *.19 |
(deftest *.19 |
238 |
(let ((bound (- (sqrt most-positive-short-float) 1)) |
(let ((bound (- (sqrt most-positive-short-float) 1)) |
239 |
(bound2 (- (sqrt most-positive-double-float) 1))) |
(bound2 (- (sqrt most-positive-double-float) 1))) |
240 |
(loop for x = (- (random (* bound 2)) bound) |
(loop for x = (random-from-interval bound) |
241 |
for y = (- (random (* bound2 2)) bound2) |
for y = (random-from-interval bound2) |
242 |
for p = (* x y) |
for p = (* x y) |
243 |
repeat 10000 |
repeat 10000 |
244 |
unless (and (eql p (* y x)) |
unless (and (eql p (* y x)) |
249 |
(deftest *.20 |
(deftest *.20 |
250 |
(let ((bound (- (sqrt most-positive-short-float) 1)) |
(let ((bound (- (sqrt most-positive-short-float) 1)) |
251 |
(bound2 (- (sqrt most-positive-long-float) 1))) |
(bound2 (- (sqrt most-positive-long-float) 1))) |
252 |
(loop for x = (- (random (* bound 2)) bound) |
(loop for x = (random-from-interval bound) |
253 |
for y = (- (random (* bound2 2)) bound2) |
for y = (random-from-interval bound2) |
254 |
for p = (* x y) |
for p = (* x y) |
255 |
repeat 10000 |
repeat 10000 |
256 |
unless (and (eql p (* y x)) |
unless (and (eql p (* y x)) |
261 |
(deftest *.21 |
(deftest *.21 |
262 |
(let ((bound (- (sqrt most-positive-single-float) 1)) |
(let ((bound (- (sqrt most-positive-single-float) 1)) |
263 |
(bound2 (- (sqrt most-positive-double-float) 1))) |
(bound2 (- (sqrt most-positive-double-float) 1))) |
264 |
(loop for x = (- (random (* bound 2)) bound) |
(loop for x = (random-from-interval bound) |
265 |
for y = (- (random (* bound2 2)) bound2) |
for y = (random-from-interval bound2) |
266 |
for p = (* x y) |
for p = (* x y) |
267 |
repeat 10000 |
repeat 10000 |
268 |
unless (and (eql p (* y x)) |
unless (and (eql p (* y x)) |
273 |
(deftest *.22 |
(deftest *.22 |
274 |
(let ((bound (- (sqrt most-positive-single-float) 1)) |
(let ((bound (- (sqrt most-positive-single-float) 1)) |
275 |
(bound2 (- (sqrt most-positive-long-float) 1))) |
(bound2 (- (sqrt most-positive-long-float) 1))) |
276 |
(loop for x = (- (random (* bound 2)) bound) |
(loop for x = (random-from-interval bound) |
277 |
for y = (- (random (* bound2 2)) bound2) |
for y = (random-from-interval bound2) |
278 |
for p = (* x y) |
for p = (* x y) |
279 |
repeat 10000 |
repeat 10000 |
280 |
unless (and (eql p (* y x)) |
unless (and (eql p (* y x)) |
285 |
(deftest *.23 |
(deftest *.23 |
286 |
(let ((bound (- (sqrt most-positive-double-float) 1)) |
(let ((bound (- (sqrt most-positive-double-float) 1)) |
287 |
(bound2 (- (sqrt most-positive-long-float) 1))) |
(bound2 (- (sqrt most-positive-long-float) 1))) |
288 |
(loop for x = (- (random (* bound 2)) bound) |
(loop for x = (random-from-interval bound) |
289 |
for y = (- (random (* bound2 2)) bound2) |
for y = (random-from-interval bound2) |
290 |
for p = (* x y) |
for p = (* x y) |
291 |
repeat 10000 |
repeat 10000 |
292 |
unless (and (eql p (* y x)) |
unless (and (eql p (* y x)) |