Anonymous user
Addition-chain exponentiation: Difference between revisions
m
→{{header|MATLAB}} / {{header|Octave}}: format
m (→{{header|Go}}: bug fix.) |
m (→{{header|MATLAB}} / {{header|Octave}}: format) |
||
Line 440:
=={{header|MATLAB}} / {{header|Octave}}==
I assume that Matlab and Octave have about such optimization already included. On a single core of an "Pentium(R) Dual-Core CPU E5200 @ 2.50GHz", the computation of 100000 repetitions of the matrix exponentiation A
<lang Matlab>x = sqrt(.5);
A = [x,0,x,0,0,0;0,x,0,x,0,0; 0,x,0,-x,0,0;-x,0,x,0,0,0;0,0,0,0,0,1; 0,0,0,0,1,0];A
|