Preply — Study more efficiently by working with a personal tutor. Get 50% off.Affiliate

Wikipedia

Symmetric level-index arithmetic

The level-index (LI) representation of numbers, and its algorithms for arithmetic operations, were introduced by Charles Clenshaw and Frank Olver in 1984. The symmetric form of the LI system and its arithmetic operations were presented by Clenshaw and Peter Turner in 1987. 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 X as

X = e e e ⋅ ⋅ ⋅ e f , {\displaystyle X=e^{e^{e^{\cdot ^{\cdot ^{\cdot ^{e^{f}}}}}}},}

where 0 ≤ f < 1 {\displaystyle 0\leq f<1} , and the process of exponentiation is performed ℓ times, with ℓ ≥ 0 {\displaystyle \ell \geq 0} . ℓ and f are the level and index of X respectively. x = ℓ + f is the LI image of X. For example,

X = 1234567 = e e e 0.9711308 , {\displaystyle X=1234567=e^{e^{e^{0.9711308}}},}

so its LI image is

x = ℓ + f = 3 + 0.9711308 = 3.9711308. {\displaystyle x=\ell +f=3+0.9711308=3.9711308.}

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

ψ ( X ) = { X if 0 ≤ X < 1 , 1 + ψ ( ln ⁡ X ) if X ≥ 1 , {\displaystyle \psi (X)={\begin{cases}X&{\text{if }}0\leq X<1,\\1+\psi (\ln X)&{\text{if }}X\geq 1,\end{cases}}}

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

φ ( x ) = { x if 0 ≤ x < 1 , e φ ( x − 1 ) if x ≥ 1. {\displaystyle \varphi (x)={\begin{cases}x&{\text{if }}0\leq x<1,\\e^{\varphi (x-1)}&{\text{if }}x\geq 1.\end{cases}}}

The density of values X represented by x has no discontinuities as we go from level ℓ to ℓ + 1 (a very desirable property) since

d φ ( x ) d x | x = 1 = d φ ( e x ) d x | x = 0 . {\displaystyle \left.{\frac {d\varphi (x)}{dx}}\right|_{x=1}=\left.{\frac {d\varphi (e^{x})}{dx}}\right|_{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 sX (0 only occurs when X = 0 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 X is less than 1. One takes sgn(log(X)) or sgn(|X| − |X|−1) and stores it as a boolean rX (0 only occurs when X = 1 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 X (not 0 or 1) as

X = s X φ ( x ) r X , {\displaystyle X=s_{X}\varphi (x)^{r_{X}},}

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

s X = sgn ⁡ ( X ) , r X = sgn ⁡ ( | X | − | X | − 1 ) , x = ψ ( max ( | X | , | X | − 1 ) ) = ψ ( s X X r X ) , {\displaystyle s_{X}=\operatorname {sgn}(X),\quad r_{X}=\operatorname {sgn} {\big (}|X|-|X|^{-1}{\big )},\quad x=\psi {\big (}\max {\big (}|X|,|X|^{-1}{\big )}{\big )}=\psi {\big (}s_{X}X^{r_{X}}{\big )},}

whereas for X = 0 or 1, we have

s 0 = + 1 , r 0 = + 1 , x = 0.0 , {\displaystyle s_{0}=+1,\quad r_{0}=+1,\quad x=0.0,}

s 1 = + 1 , r 1 = + 1 , x = 1.0. {\displaystyle s_{1}=+1,\quad r_{1}=+1,\quad x=1.0.}

For example,

X = − 1 1234567 = − e − e e 0.9711308 , {\displaystyle X=-{\dfrac {1}{1234567}}=-e^{-e^{e^{0.9711308}}},}

and its SLI representation is

x = − φ ( 3.9711308 ) − 1 . {\displaystyle x=-\varphi (3.9711308)^{-1}.}

Adding Most arithmetic operations in LI can be easily reduced to addition due to the nature of logarithms. If we have some x, y, and z related by φ ( z ) = φ ( x ) φ ( y ) {\displaystyle \varphi (z)=\varphi (x)^{\varphi (y)}} , taking the logarithm of both sides gives us φ ( z − 1 ) = φ ( y ) φ ( x − 1 ) {\displaystyle \varphi (z-1)=\varphi (y)\varphi (x-1)} , and once more gives us φ ( z − 2 ) = φ ( y − 1 ) + φ ( x − 2 ) {\displaystyle \varphi (z-2)=\varphi (y-1)+\varphi (x-2)} . The only non-trivial operation left to define is addition. The problem of addition is posed as being able to find some z, given an arbitrary x and y with φ ( x ) ≥ φ ( y ) {\displaystyle \varphi (x)\geq \varphi (y)} , such that φ ( x ) + φ ( y ) = φ ( z ) {\displaystyle \varphi (x)+\varphi (y)=\varphi (z)} . We also say that the levels of φ ( x ) {\displaystyle \varphi (x)} , φ ( y ) {\displaystyle \varphi (y)} , and φ ( z ) {\displaystyle \varphi (z)} are l, m, and n, and their indices are f, g, and h. It is helpful to define these 3 sequences, each indexed with some j:

a j = 1 φ ( x − j ) j = l − 1 , l − 2 , . . . , 0 b j = φ ( y − j ) φ ( x − j ) j = m − 1 , m − 2 , . . . , 0 c j = φ ( z − j ) φ ( x − j ) j = 0 , 1 , . . . {\displaystyle {\begin{aligned}&a_{j}={\frac {1}{\varphi (x-j)}}\quad j=l-1,\;l-2,\;...,\;0\\&b_{j}={\frac {\varphi (y-j)}{\varphi (x-j)}}\quad j=m-1,\;m-2,\;...,\;0\\&c_{j}={\frac {\varphi (z-j)}{\varphi (x-j)}}\quad j=0,\;1,\;...\\\end{aligned}}}

With this defined, we can now state that z is equal to j + c j a j {\displaystyle j+{\frac {c_{j}}{a_{j}}}} for the smallest j where c j < a j {\displaystyle c_{j}<a_{j}} . To find the actual values in these sequences, we use a set of recursive definitions each with an initial condition:

a j − 1 = e − 1 a j a l − 1 = e − f b j − 1 = e − 1 − b j a j b m − 1 = a m − 1 e g c j = 1 + a j ln ⁡ ( c j − 1 ) c 0 = 1 + b 0 {\displaystyle {\begin{aligned}a_{j-1}&=e^{-{\frac {1}{a_{j}}}}&a_{l-1}&=e^{-f}\\b_{j-1}&=e^{-{\frac {1-b_{j}}{a_{j}}}}&b_{m-1}&=a_{m-1}e^{g}\\[8pt]c_{j}&=1+a_{j}\ln(c_{j-1})\!\!\!\!\!\!\!\!\!\!\!\!&c_{0}&=1+b_{0}\end{aligned}}}

This can also be used to implement subtraction by changing the initial condition for c to be c 0 = 1 − b 0 {\displaystyle c_{0}=1-b_{0}} . When using SLI, φ ( x ) + φ ( y ) = φ ( z ) {\displaystyle \varphi (x)+\varphi (y)=\varphi (z)} is not the only case; φ ( x ) + 1 / φ ( y ) = φ ( z ) {\displaystyle \varphi (x)+\,^{1}\!{\big /}\!_{\varphi (y)}=\varphi (z)} and 1 / φ ( x ) + 1 / φ ( y ) = 1 / φ ( z ) {\displaystyle \,^{1}\!{\big /}\!_{\varphi (x)}+\,^{1}\!{\big /}\!_{\varphi (y)}=\,^{1}\!{\big /}\!_{\varphi (z)}} should also be considered; typically called "large", "mixed", and "small" arithmetic. In mixed arithmetic, we replace the b sequence with α j = 1 / φ ( y − j ) {\displaystyle \alpha _{j}=\,^{1}\!{\big /}\!_{\varphi (y-j)}} and define c 0 {\displaystyle c_{0}} as c 0 = 1 + a 0 α 0 {\displaystyle c_{0}=1+a_{0}\alpha _{0}} ; and in small arithmetic we replace the b sequence with β j = φ ( x − j ) / φ ( y − j ) {\displaystyle \beta _{j}=\,^{\varphi (x-j)}\!{\big /}\,\!_{\varphi (y-j)}} , and c 0 {\displaystyle c_{0}} becomes c 0 = 1 / 1 + β 0 {\displaystyle c_{0}=\,^{1}\!{\big /}\,\!_{1+\beta _{0}}}

See also Tetration Floating point (FP) Tapered floating point (TFP) Logarithmic number system (LNS) Level (logarithmic quantity)

References

Further reading Clenshaw, Charles William; Olver, Frank William John; Turner, Peter R. (1989). "Level-index arithmetic: An introductory survey". Numerical Analysis and Parallel Processing (Conference proceedings / The Lancaster Numerical Analysis Summer School 1987). Lecture Notes in Mathematics (LNM). 1397: 95–168. doi:10.1007/BFb0085718. ISBN 978-3-540-51645-3.{{cite journal}}: CS1 maint: periodical has ISBN (link) Clenshaw, Charles William; Turner, Peter R. (1989-06-23) [1988-10-04]. "Root Squaring Using Level-Index Arithmetic". Computing. 43 (2). Springer-Verlag: 171–185. doi:10.1007/BF02241860. ISSN 0010-485X. Zehendner, Eberhard (Summer 2008). "Rechnerarithmetik: Logarithmische Zahlensysteme" (PDF) (Lecture script) (in German). Friedrich-Schiller-Universität Jena. pp. 21–22. Archived (PDF) from the original on 2018-07-09. Retrieved 2018-07-09. [1] Hayes, Brian (September–October 2009). "The Higher Arithmetic". American Scientist. 97 (5): 364–368. doi:10.1511/2009.80.364. Archived from the original on 2018-07-09. Retrieved 2018-07-09. [2]. Also reprinted in: Hayes, Brian (2017). "Chapter 8: Higher Arithmetic". Foolproof, and Other Mathematical Meditations (1 ed.). The MIT Press. pp. 113–126. ISBN 978-0-26203686-3. ISBN 0-26203686-X.

External links sli-c-library (hosted by Google Code), "C++ Implementation of Symmetric Level-Index Arithmetic".

Tags

  • Computer arithmetic
  • Numeral systems