Talk:Addition-chain exponentiation: Difference between revisions

m
Line 26:
 
: A '''little''' puzzle is quite an understatement -- the task asks for the optimal chain of a 9 digit number, for which I don't know if there is a practical method (even though its factorization is known, it might not help: see 77 and 154). Secondly, matrix-related tasks show up a lot on RC, which is both tedious to do and difficult to do right. It also has another problem: binary expo requires fixed amount of storage for temp matrix result (the current square), while an optimal chain may require variable temp storage (chain for 9 requires saving result 3 or 4 for future use depending on the chain taken) which can be a pain for languages without GC. I think it's sufficient to just mention where addition chains can be useful, while the task only needs to implement the part of finding the chains for a given number. --[[User:Ledrug|Ledrug]] 06:34, 27 August 2011 (UTC)
 
OK. I will drop the use of matrices, I also find using libraries a pain as often the libraries are language release specific. As an alternative test case we can use the languages built in [[wp:complex numbers|complex numbers]] type, and the test cases:
* 1.0000254989+0.0000577896i<sup>31415</sup> = 2
* 1.0000220632+0.0000500026i<sup>27182</sup> = 2.
 
And then only the chains for 31415 and 27182 is required.
 
[[User:NevilleDNZ|NevilleDNZ]] 08:09, 27 August 2011 (UTC)
 
== Inefficient chain finding ==