diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-05-31 21:22:06 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-05-31 21:29:44 -0400 |
| commit | dcd886d3a4b03b869c0d27dcaa09302d9cf40de8 (patch) | |
| tree | 084d60b191be6e85794536d23eed1baf7b0f8d2e | |
| parent | 0163eff25ca598656247ea3041621752268f0859 (diff) | |
Float generation
| -rw-r--r-- | test/fuzz.bqn | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/test/fuzz.bqn b/test/fuzz.bqn index 7a2dba09..74944849 100644 --- a/test/fuzz.bqn +++ b/test/fuzz.bqn @@ -42,8 +42,16 @@ Sigmoid ← (40≤|)◶⟨1(-÷+)˜⋆,×⟩ } # 𝕨 is 2⋆⁼bits in type; 𝕩 is shape -⟨RandTyped,RandArith⟩ ← { - RandTyped ⇐ { (1⊸<⊸×m÷2) -˜ 𝕩 Range m←(𝕨<6)×2⋆2⋆𝕨 } +⟨RandArith⟩ ← { + RandInt ← { (1⊸<⊸×m÷2) -˜ 𝕩 Rand m←2⋆2⋆𝕨 } + + floats ← ⟨2⋆¯1074,2⋆¯1022,(2-2⋆¯52)×2⋆1023⟩ + RandFloat ← ⟨ + (floats∾2⋆0‿8‿32‿100)_randChoose × Range⟜0 - 2÷˜Rand∘3 + ⊢ (Rand⟜≠⊏⊢) (Rand(⊣≥⌈´⊸⌊)3+Rand∘+)˜∘≠⊸/∘(∾⟜-0∾floats∾∞) + ⟩_randChoose + + RandTyped ← =⟜6◶⟨RandInt,RandFloat⊣⟩ RN ← (0⌈-⟜1) ⌊ 1‿RandRank‿RandBound _randChoose RandSplit ← ⌽⍟(Rand∘2) (-≍⊢)⟜RN @@ -67,4 +75,4 @@ RandDyArith ← { } types ← 0‿3‿4‿5‿6 -types { ! (𝕨+𝕩)≡𝕨--𝕩 }´∘RandDyArith⌜ 100⥊1e3 +types { ! (𝕨+𝕩)≡◶⟨∧´∘⥊=∨∧○(≠˜),1⟩𝕨--𝕩 }´∘RandDyArith⌜ 100⥊1e3 |
