Friday 25 November 2022

Beautiful methods of reckoning

After a bit of thought, I've managed to come up with two expressions that define exactly what it is that the TLC algorithm (described earlier) computes.

For a given ALPHA, BETA and GAMMA, the algorithm computes one of the following two quantities. P if the d = d * b operation (OP#1) is included, and Q if it is omitted.

In the above, the ⊡ symbol means an arithmetic/logical operator; for the TLC project it's one of those implemented by the 74181 arithmetic logic unit, as listed in the previous post. To avoid division by zero, instances for which γk ⊡ α = 0 are replaced with unity.

(Numerical experiments suggest that the above expressions work for all the arithmetic/logical operations supported by the 74181 as listed in the previous post. An obvious (unanswered) question is this: what other operations does the algorithm work for?)

So, for example, for the π calculation operator ⊡ is A MINUS B (i.e. ALU row 6, column 2). And we set ALPHA = 1, BETA = 20 and GAMMA = 2, and thus compute the quantity given by

where operation OP#1 is included (i.e. in this mode the upper of the two equations is computed (P)). 

Omitting OP#1 (i.e. the lower of the two equations is computed (Q)), gives


where erf (x) is the error function. The first 2504 digits of the value produced by the TLC algorithm are correct. (This constant is mentioned in Finch, Mathematical Constants: 94 (Encyclopedia of Mathematics and its Applications), p. 423.)

Note: the TTL implementation of the TLC algorithm represents the algorithm's different variables using various limited numbers of bits - for example the d = d * b operation (OP#1) uses a 6 bit times 10 bit multiplier to yield a 15 bit result (bit 16 is ignored). This means that the actual value produced by the TTL implementation may differ from that produced by the above expressions for P and Q. This is not always the case, however - the algorithm produces 266 correct digits of π, with or without the TTL implementation's finite bit widths (with parameter b = 888).

On the other hand, ALU(9,1) (i.e. PLUS operation), with ALPHA = 1, BETA = 10, GAMMA = 1, and OP#1 enabled, yields

0.9989875126560917988525143... = 2960/2963 (no limitation on bit width)

and 

1.2202931302994487041321361... (TTL implementation).

As discussed in a later post (26th November), neither of these values agrees with the 'expected' result (unity).









No comments:

Post a Comment