diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-07-31 10:47:53 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-07-31 10:47:53 -0400 |
| commit | 1a15fa1cb984dd1d6bd3f5c5b56e0169b1085edf (patch) | |
| tree | cb57cee8bdf8f9e8bcfb5617c400a8630c0f2784 | |
| parent | 0d13401bde67f9e8106d8189eec2edb9662d4436 (diff) | |
Use dyadic inverse instead of inverting a train
| -rwxr-xr-x | c.bqn | 2 | ||||
| -rwxr-xr-x | dzref_full | 2 | ||||
| -rw-r--r-- | impl.bqn | 6 | ||||
| -rwxr-xr-x | test/cmpref.bqn | 2 |
4 files changed, 6 insertions, 6 deletions
@@ -193,7 +193,7 @@ DParse ← {nv‿r𝕊𝕩: or←⍋idor∾g⊏˜∾⟨cn,cn,b,b,rt,dr,l,l,si,si,at,oa+1⌈oa⊏os,(dy×⊏⟜os)⊸+fa+dy⟩ bc0←∾idbc∾⟨0¨cn,u⊐ob,15¨b,1+↕≠b⟩ - bc←or⊏bc0∾∾⟨25¨rt,14¨dr,3+l⊏aa,ll,3+si⊏aa,sll,(11-⊑bG)+a/ma+𝕩,5+oa⊏r,16+dy-7×fa⊏tr⟩ + bc←or⊏bc0∾∾⟨25¨rt,14¨dr,3+l⊏aa,ll,3+si⊏aa,sll,(11-⊑bG)+a/ma+𝕩,5+oa⊏r,(⊢+9×10⊸=)16+dy-7×fa⊏tr⟩ fs←(ft⊏⥊"fmd"≍⌜⌽↕2)∾¨((+`0∾1+⌊128⋆⁼1⌈bc)⊏˜/1∾or∊bc0+⟜↕○≠rt)≍○<¨(ft⊏spd)∾⟜(⥊¨↑⟜•a)¨lc ⟨LEBv bc,u,fs⟩ } @@ -10,7 +10,7 @@ impl ← •LNS "impl.bqn" X←Raw←{≤4} { chrs←⟨ - "!+-×÷⋆√⌊⌈∧∨¬|=≠≤<>≥≡≢⊣⥊∾≍↑↓↕⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔" + "!+-×÷⋆√⌊⌈∧∨¬|=≠≤<>≥≡≢⊣⊢⥊∾≍↑↓↕⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔" "˜˘¨⌜⁼´˝`" "∘⊸⟜○⌾⎉⚇⍟◶⊘" ⟩ @@ -1,6 +1,6 @@ ◶ ← {𝕨((𝕨𝔽𝕩)⊑𝕘){𝔽}𝕩} # LIMITED to number left operand result ⊘ ← {𝕨((1{𝔽}𝕨)-0)◶𝔽‿𝔾 𝕩} -#⊢ ← {𝕩} # Prevents dyadic negative ⍟ +⊢ ← {𝕩} ⊣ ← {𝕩}⊘{𝕨} ˜ ← {𝕩𝔽𝕨⊣𝕩} ∘ ← {𝔽𝕨𝔾𝕩} @@ -394,11 +394,11 @@ ProgressiveIndexOf ← {𝕨⊐○(≍˘⟜OccurrenceCount𝕨⊸⊐)𝕩} _repeat_←{ n←𝕨𝔾𝕩 - f←0⊑𝕨⟨𝔽⟩⊘⟨𝕨𝔽⊢⟩𝕩 l←u←0 {!Int𝕩⋄l↩l⌊𝕩⋄u↩u⌈𝕩}⚇0 n a←𝕩⋄_p←{𝔽∘⊣`(1+𝕩)⥊<a} - pos←F _p u ⋄ neg←F⁼_p-l + pos←(𝕨𝔽 ⊢)_p u + neg←(𝕨𝔽⁼⊢)_p-l (|⊑<⟜0⊑pos‿neg˜)⚇0 n } ⍟ ↩ _repeat_ diff --git a/test/cmpref.bqn b/test/cmpref.bqn index 029af28c..8186889a 100755 --- a/test/cmpref.bqn +++ b/test/cmpref.bqn @@ -7,7 +7,7 @@ impl ← •LNS •path∾"../impl.bqn" drun ← ((<•path∾"../c.bqn")∾<"DRun") •EX •path∾"../dzref" chrs←⟨ - "!+-×÷⋆√⌊⌈∧∨¬|=≠≤<>≥≡≢⊣⥊∾≍↑↓↕⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔" + "!+-×÷⋆√⌊⌈∧∨¬|=≠≤<>≥≡≢⊣⊢⥊∾≍↑↓↕⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔" "˜˘¨⌜⁼´˝`" "∘⊸⟜○⌾⎉⚇⍟◶⊘" ⟩ |
