|
In the tristream implementation, a simple exact rational like 1/2 is a repeating infinite stream. Therefore multiplication becomes slower than in the precfunc implementation.
It's true that many tristream rationals have infinitely many nonzero trits in their expansions. But I don't think that's a good explanation of the reason that tristream multiplications are sometimes much slower than precfunc multiplications.
Like precfunc, the time cost of tristream operations also depends on several structural qualities of the computation, including the cost of generating trits and the number of trits generated. Since the estimation of the required precision in tristream is implicit (in the number of trits required in one step in order to determine the desired number of trits in the next step) instead of explicit (in the precision arguments passed to precfunc xreals), you need to study this issue carefully to determine how much precision (i.e., how many trits) is really being computed.
A very good question to work on is: in order to generate p trits of a product, how many trits does mult_xreal demand from its arguments. Then consider how that demand propagates backwards through a sequence of multiplications.
Mike O'D.
|