]> gitweb.factorcode.org Git - factor.git/blob - extra/benchmark/matrix-exponential-simd/matrix-exponential-simd.factor
core: Rename iota to <iota> so we can have TUPLE: iota ... ; instead of TUPLE: iota...
[factor.git] / extra / benchmark / matrix-exponential-simd / matrix-exponential-simd.factor
1 USING: locals math math.combinatorics math.matrices.simd
2 prettyprint sequences typed ;
3 IN: benchmark.matrix-exponential-simd
4
5 TYPED:: e^m4 ( m: matrix4 iterations: fixnum -- e^m: matrix4 )
6     zero-matrix4
7     iterations <iota> [| i |
8         m i m4^n i factorial >float m4/n m4+
9     ] each ;
10
11 :: matrix-exponential-simd-benchmark ( -- )
12     f :> result!
13     10000 [
14         identity-matrix4 20 e^m4 result!
15     ] times
16     result . ;
17
18 MAIN: matrix-exponential-simd-benchmark