Y
Hacker News
new
|
ask
|
show
|
jobs
by
karamazov
1926 days ago
Or use the closed-form solution.
1 comments
jacobolus
1926 days ago
The "closed-form solution" is slower than standard method. It just uses arbitrary-precision fractional arithmetic (square root, exponentiation, division) instead of arbitrary-precision integer arithmetic (exponentiation of a 2x2 integer matrix).
link
singhrac
1926 days ago
The best solution is to use the O(log n) time exponentiation of a matrix, which is fast enough to be constant.
link