diff --git a/contrib/random-tester/load.factor b/contrib/random-tester/load.factor index 38cc47b0db..06583c7cb6 100644 --- a/contrib/random-tester/load.factor +++ b/contrib/random-tester/load.factor @@ -1,8 +1,6 @@ USING: kernel parser sequences words compiler ; IN: scratchpad -"contrib/math/utils.factor" run-resource - { "utils" "random" diff --git a/contrib/random-tester/random-tester.factor b/contrib/random-tester/random-tester.factor index 456636ac36..e13a17840d 100644 --- a/contrib/random-tester/random-tester.factor +++ b/contrib/random-tester/random-tester.factor @@ -1,5 +1,5 @@ USING: kernel math sequences namespaces errors hashtables words arrays parser - compiler syntax lists io math-contrib ; + compiler syntax lists io ; USING: inspector prettyprint ; USING: optimizer compiler-frontend compiler-backend inference ; IN: random-tester @@ -67,10 +67,10 @@ IN: random-tester : float>x ( float -- x ) { 1+ 1- >bignum >digit >fixnum abs absq arg - cis conjugate cos cosec cosech - cosh cot coth double>bits exp float>bits imaginary + ceiling cis conjugate cos cosec cosech + cosh cot coth double>bits exp float>bits floor imaginary log neg next-power-of-2 quadrant real sec - sech sgn sin sinh sq sqrt tan tanh + sech sgn sin sinh sq sqrt tan tanh truncate } ; : complex>x diff --git a/contrib/random-tester/random.factor b/contrib/random-tester/random.factor index 4abd1a0d46..6efda3152b 100644 --- a/contrib/random-tester/random.factor +++ b/contrib/random-tester/random.factor @@ -1,5 +1,5 @@ USING: kernel math sequences namespaces errors hashtables words arrays parser - compiler syntax lists io math-contrib ; + compiler syntax lists io ; USING: inspector prettyprint ; USING: optimizer compiler-frontend compiler-backend inference ; IN: random-tester diff --git a/contrib/random-tester/utils.factor b/contrib/random-tester/utils.factor index f2fd0a0228..84371a75f9 100644 --- a/contrib/random-tester/utils.factor +++ b/contrib/random-tester/utils.factor @@ -1,10 +1,12 @@ USING: kernel math sequences namespaces errors hashtables words arrays parser - compiler syntax lists io math-contrib ; + compiler syntax lists io ; USING: optimizer compiler-frontend compiler-backend inference inspector prettyprint ; IN: random-tester +: nth-rand ( seq -- elem ) [ length random-int ] keep nth ; + ! HASHTABLES : random-hash-entry ( hash -- key value ) hash>alist nth-rand first2 ;