[Jprogramming] Equilibrium index
Raul Miller
rauldmiller at gmail.com
Sun Sep 26 09:16:48 HKT 2010
On Sat, Sep 25, 2010 at 11:47 AM, Viktor Cerovski
<viktor.cerovski at gmail.com> wrote:
> Some improvement (about 10% in speed) of eq1,2,3
> is possible if we notice:
>
> f/ === {:@(f/\) === {.@(f/\.)
>
> so there is no need to compute the sum after computing the partial sum,
> and we get:
>
> eq2a =: I.@({:@] = +:@] - [) +/\
But this is still slower than eq0 on my system:
d=: _10+?1e7#21
(eq2a-:eq0) d
1
ts=:6!:2,7!:2
ts 'eq0 d'
0.187684 2.85214e8
ts 'eq2a d'
0.21509 4.02655e8
--
Raul
More information about the Programming
mailing list