foo1←(((2|⊢)×1+3×⊢)+(~2|⊢)×0.5×⊢)
foo2←(6÷⍨¯1+⊢)@(2|⊢)(1+3×⊢)
foo3←{(b×1+3×⍵)+⍵×0.5×~b←2|⍵}
foo4←{2÷⍨@(⍸~b)⊢(1+3×⊢)@(⍸b←2|⍵)⊢⍵}
foo5←{(⊂⍋⍋b)⌷(0.5×(~b)/⍵),1+3×⍵/⍨b←2|⍵}
foo6←{b←2|v←⍵ ⋄ v[⍸b]←1+3×b/v ⋄ v[⍸~b]←0.5×(~b)/v ⋄ v}
foo7←{2|⍵:1+3×⍵ ⋄ ⍵÷2}¨
foo8←{b←2|⍵ ⋄ (~b){2÷⍨⍣⍺⊢⍵}¨b{(1+3×⊢)⍣⍺⊢⍵}¨⍵}
w←1e5?1e6
]runtime -c "foo1 w" "foo2 w" "foo3 w" "foo4 w" "foo5 w" "foo6 w" "foo7 w" "foo8 w"
foo1 w → 5.8E¯4 | 0%
foo2 w → 7.3E¯4 | +25%
foo3 w → 8.9E¯4 | +54%
foo4 w → 1.0E¯3 | +81% ⎕
foo5 w → 1.5E¯3 | +154% ⎕
foo6 w → 1.7E¯3 | +190% ⎕
foo7 w → 2.0E¯2 | +3345% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
foo8 w → 7.2E¯2 | +12363% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
-wm