Addition-chain exponentiation: Difference between revisions
Content added Content deleted
(→{{header|MATLAB}} / {{header|Octave}}: wrong answer) |
|||
Line 440: | Line 440: | ||
=={{header|MATLAB}} / {{header|Octave}}== |
=={{header|MATLAB}} / {{header|Octave}}== |
||
{{incorrect|matlab|Assuming that Matlab or Octave has an optimal algorithm is certainly not enough: the problem is difficult and it's highly likely that they both use a variant of binary exponentiation instead, which is usually enough, but not in the scope of the task}} |
|||
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<sup>27182</sup> and A<sup>31415</sup> take about 2 and 2.2 seconds, resp. |
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<sup>27182</sup> and A<sup>31415</sup> take about 2 and 2.2 seconds, resp. |
||
<lang Matlab>x = sqrt(.5); |
<lang Matlab>x = sqrt(.5); |