Symmetric level-index arithmetic

From testwiki
Jump to navigation Jump to search

Template:Short description Template:Use dmy dates The level-index (LI) representation of numbers, and its algorithms for arithmetic operations, were introduced by Charles Clenshaw and Frank Olver in 1984.[1]

The symmetric form of the LI system and its arithmetic operations were presented by Clenshaw and Peter Turner in 1987.[2]

Michael Anuta, Daniel Lozier, Nicolas Schabanel and Turner developed the algorithm for symmetric level-index (SLI) arithmetic, and a parallel implementation of it. There has been extensive work on developing the SLI arithmetic algorithms and extending them to complex and vector arithmetic operations.

Definition

The idea of the level-index system is to represent a non-negative real number Template:Mvar as

X=eee⋅⋅⋅ef,

where 0≤f<1, and the process of exponentiation is performed Template:Mvar times, with ℓ≥0. Template:Mvar and Template:Mvar are the level and index of Template:Mvar respectively. Template:Math is the LI image of Template:Mvar. For example,

X=1234567=eee0.9711308,

so its LI image is

x=ℓ+f=3+0.9711308=3.9711308.

The mapping function is called the generalized logarithm function. It is defined as

ψ(X)={Xif 0≤X<1,1+ψ(ln⁡X)if X≥1,

and it maps [0,∞) onto itself monotonically, thus being invertible on this interval. The inverse, the generalized exponential function, is defined by

φ(x)={xif 0≤x<1,eφ(x−1)if x≥1.

The density of values Template:Mvar represented by Template:Mvar has no discontinuities as we go from level Template:Mvar to Template:Math (a very desirable property) since

dφ(x)dx|x=1=dφ(ex)dx|x=0.

The generalized logarithm function is closely related to the iterated logarithm used in computer science analysis of algorithms.

A sign bit may also be used to allow negative numbers. One takes sgn(X) and stores it as a boolean Template:Mvar (0 only occurs when Template:Math so could be stored either way, +1 chosen here). Mathematically, this is equivalent to taking the negative (additive inverse) of a number, and finding the SLI image for that. Using one bit for the sign enables the representation of negative numbers.

The symmetric form is used to allow negative exponents, if the magnitude of Template:Mvar is less than 1. One takes Template:Math or Template:Math and stores it as a boolean Template:Mvar (0 only occurs when Template:Math so could be stored either way, +1 chosen here). Mathematically, this is equivalent to taking the reciprocal (multiplicative inverse) of a small-magnitude number, and finding the SLI image for that. Using one bit for the reciprocal sign enables the representation of extremely small numbers.

Formally, we can define the SLI representation for an arbitrary real Template:Mvar (not 0 or 1) as

X=sXφ(x)rX,

where Template:Mvar is the sign (additive inversion or not) of Template:Mvar, and Template:Mvar is the reciprocal sign (multiplicative inversion or not) as in the following equations:

sX=sgn⁡(X),rX=sgn⁡(|X|−|X|−1),x=ψ(max⁡(|X|,|X|−1))=ψ(sXXrX),

whereas for Template:Mvar = 0 or 1, we have

s0=+1,r0=+1,x=0.0,
s1=+1,r1=+1,x=1.0.

For example,

X=−11234567=−e−ee0.9711308,

and its SLI representation is

x=−φ(3.9711308)−1.

Adding

Most arithmetic operations in LI can be easily reduced to addition due to the nature of logarithms.[3] If we have some Template:Mvar, Template:Mvar, and Template:Mvar related by φ(z)=φ(x)φ(y), taking the logarithm of both sides gives us φ(z−1)=φ(y)φ(x−1), and once more gives us φ(z−2)=φ(y−1)+φ(x−2). The only non-trivial operation left to define is addition.

The problem of addition is posed as being able to find some Template:Mvar, given an arbitrary Template:Mvar and Template:Mvar with φ(x)≥φ(y), such that φ(x)+φ(y)=φ(z). We also say that the levels of φ(x), φ(y), and φ(z) are Template:Mvar, Template:Mvar, and Template:Mvar, and their indices are Template:Mvar, Template:Mvar, and Template:Mvar. It is helpful to define these 3 sequences, each indexed with some Template:Mvar:

aj=1φ(x−j)j=l−1,l−2,...,0bj=φ(y−j)φ(x−j)j=m−1,m−2,...,0cj=φ(z−j)φ(x−j)j=0,1,...

With this defined, we can now state that Template:Mvar is equal to j+cjaj for the smallest Template:Mvar where cj<aj. To find the actual values in these sequences, we use a set of recursive definitions each with an initial condition:

aj−1=e−1ajal−1=e−fbj−1=e−1−bjajbm−1=am−1egcj=1+ajln⁡(cj−1)c0=1+b0


This can also be used to implement subtraction by changing the initial condition for Template:Mvar to be c0=1−b0.

When using SLI, φ(x)+φ(y)=φ(z) is not the only case; φ(x)+1/φ(y)=φ(z) and 1/φ(x)+1/φ(y)=1/φ(z) should also be considered; typically called "large", "mixed", and "small" arithmetic. In mixed arithmetic, we replace the Template:Mvar sequence with αj=1/φ(y−j) and define c0 as c0=1+a0α0; and in small arithmetic we replace the Template:Mvar sequence with βj=φ(x−j)/φ(y−j), and c0 becomes c0=1/1+β0

See also

References

Template:Reflist

Further reading

  1. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named "Clenshaw_1984".
  2. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named "Clenshaw_1988".
  3. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named "Clenshaw_1989".