Hi.

Here's the long-awaited description of the numerical algorithm for the Fourier-continuum-sum-based tetration. It actually took a LOT more to describe than I thought it would...

Periodic approximation

As was mentioned in the posts on the subject, the continuum sum for a holomorphic function is constructed as a limit of continuum sums of periodic approximations of it, that is, a sequence of periodic functions which converge pointwise to the target function .

The idea behind the numerical algorithm, then, is to use a periodic function with a very large period as an approximation to a general function in the vicinity of zero.

That is, we work with an approximation to the desired function given by

(which in a computer would be truncated to a sum from to for some )

where is the period, and large.

Because certain operations in the tetration continuum-sum iteration destroy periodicity (especially the multiplication by and the final integral), we must have a way to restore it. We do this via what is called a periodizing function. A periodizing function generates a periodic approximation of a given function by composition, i.e. , with period . This means the function should, at bare minimum, satisfy

1. periodic with period :

2.

Other desirable properties are

3. entire

4. for any compact subset of , and a given , there exists an such that whenever for all .

An example of such a function is . Property 4 is sort of like compact convergence of a sequence of functions but with a complex index, and is nice because it means that past a certain point, we can just increase 's magnitude to make a better approximation of the identity around 0.

Implementing the tetration formula

We can now discuss how we'd implement the iteration. We work with an approximation of the form

.

(the reason for using instead of will be clear later)

and perform the following operations.

Continuum sum

The continuum sum, , is achieved by setting

,

.

(from .)

And so we have . We can store separately for the next operation.

Exponential

The exponential of the continuum sum is done by treating the series as a pair of Taylor series in and , and then applying Faà di Bruno's formula and multiplying the results via the convolution, however this method is not very fast and seems to not be as stable as we might like (though keeping more "slop" terms beyond -N and N index seems to help, but that just makes it even slower).

Though with a good program like Pari/GP, the formal exponential of a power series is already implemented and so there's no need to implement all that ourselves.

However, we can do a lot better.

Fourier transform

A Fourier series, such as the one above, can be thought of as a sort of "Fourier interpolation" between points in the "spatial" domain. It is possible to transform from one to the other and back via the discrete Fourier transform, or DFT. Let's see how that works.

We first transform the function so it has period (note now that "H" is for "half" as in half of N, rounded down), giving

.

Now consider the "discrete sampling" of this at integer inputs, giving a sequence indexed from to :

.

This bears a great similarity to the formula for the inverse discrete Fourier transform (IDFT) of a sequence :

.

The only difference is the frequency elements involved, and the presence of the normalization factor . This means that our Fourier series can be thought of as an interpolation of a regularly-spaced grid of points along one period interval. Our sampling at discrete points then creates a list of all those points, to which we can then directly apply transcendental functions like exponential. This method may not be as accurate as the first (note the limited amount of terms), but it can be much faster and also seems numerically more stable and with enough terms to begin with, it can still be quite accurate.

If we can relate the formula to the IDFT, then we can also give the transform to get back to Fourier space, and, even more powerfully, we can harness the high-speed Fast Fourier Transform (FFT) algorithm to rapidly perform this computation, blowing the other method out of the water.

So how do we relate this to the IDFT? Consider the following process: First off, we renumber the elements of from to , giving:

.

where is the renumbered sequence.

Note the exponent in the exponential -- the displacement by H. Expanding this out, we see that we have

.

.

and thus a regular IDFT (sans the normalization factor) on the right.

However, by the Fourier shift theorem, the multiplication of the spatial-domain data by is equivalent a cyclical shift of by H. Namely, it corresponds to transforming . We can cancel the effects of this shift by cycle-shifting the other way, forming and taking the inverse DFT of it multiplied by (to account for the normalization factor).

There's one final point: the given formula was for numbered from to . However, the (I)DFT is usually done with the numbering from to . This is not a problem: if we use a regular (I)DFT algorithm, we'll get through followed by through . A simple right cyclic shift by resolves this and gives the data in the correct order, though such is not really needed for evaluating transcendental functions.

Then to transform from the spatial domain back to the frequency domain, we do all that in reverse: left cycle-shift by , preform forward DFT, divide by , then cycle-shift the result right by and renumber.

Log-power of base and final integral

In the given program, I lump these two steps together. The end result of the last step should be a series of coefficients giving an approximation to the exponential of the continuum sum of :

.

We can now multiply by , giving

and integrate, to get

.

(YES, I know I'm abusing the integral notation with the "z" in both the limits and the variable, but it's to try to make it clearer and more consistent.)

We can then composite this with the periodizing function to get a periodic function out the end with the period we desired, and a pointwise evaluation and DFT will give us the new Fourier series for the next iteration cycle. The normalization step (for the derivative-at-0 bit) is real easy, just evaluate at 0 and divide the thing by the result.

Here's the long-awaited description of the numerical algorithm for the Fourier-continuum-sum-based tetration. It actually took a LOT more to describe than I thought it would...

Periodic approximation

As was mentioned in the posts on the subject, the continuum sum for a holomorphic function is constructed as a limit of continuum sums of periodic approximations of it, that is, a sequence of periodic functions which converge pointwise to the target function .

The idea behind the numerical algorithm, then, is to use a periodic function with a very large period as an approximation to a general function in the vicinity of zero.

That is, we work with an approximation to the desired function given by

(which in a computer would be truncated to a sum from to for some )

where is the period, and large.

Because certain operations in the tetration continuum-sum iteration destroy periodicity (especially the multiplication by and the final integral), we must have a way to restore it. We do this via what is called a periodizing function. A periodizing function generates a periodic approximation of a given function by composition, i.e. , with period . This means the function should, at bare minimum, satisfy

1. periodic with period :

2.

Other desirable properties are

3. entire

4. for any compact subset of , and a given , there exists an such that whenever for all .

An example of such a function is . Property 4 is sort of like compact convergence of a sequence of functions but with a complex index, and is nice because it means that past a certain point, we can just increase 's magnitude to make a better approximation of the identity around 0.

Implementing the tetration formula

We can now discuss how we'd implement the iteration. We work with an approximation of the form

.

(the reason for using instead of will be clear later)

and perform the following operations.

Continuum sum

The continuum sum, , is achieved by setting

,

.

(from .)

And so we have . We can store separately for the next operation.

Exponential

The exponential of the continuum sum is done by treating the series as a pair of Taylor series in and , and then applying Faà di Bruno's formula and multiplying the results via the convolution, however this method is not very fast and seems to not be as stable as we might like (though keeping more "slop" terms beyond -N and N index seems to help, but that just makes it even slower).

Though with a good program like Pari/GP, the formal exponential of a power series is already implemented and so there's no need to implement all that ourselves.

However, we can do a lot better.

Fourier transform

A Fourier series, such as the one above, can be thought of as a sort of "Fourier interpolation" between points in the "spatial" domain. It is possible to transform from one to the other and back via the discrete Fourier transform, or DFT. Let's see how that works.

We first transform the function so it has period (note now that "H" is for "half" as in half of N, rounded down), giving

.

Now consider the "discrete sampling" of this at integer inputs, giving a sequence indexed from to :

.

This bears a great similarity to the formula for the inverse discrete Fourier transform (IDFT) of a sequence :

.

The only difference is the frequency elements involved, and the presence of the normalization factor . This means that our Fourier series can be thought of as an interpolation of a regularly-spaced grid of points along one period interval. Our sampling at discrete points then creates a list of all those points, to which we can then directly apply transcendental functions like exponential. This method may not be as accurate as the first (note the limited amount of terms), but it can be much faster and also seems numerically more stable and with enough terms to begin with, it can still be quite accurate.

If we can relate the formula to the IDFT, then we can also give the transform to get back to Fourier space, and, even more powerfully, we can harness the high-speed Fast Fourier Transform (FFT) algorithm to rapidly perform this computation, blowing the other method out of the water.

So how do we relate this to the IDFT? Consider the following process: First off, we renumber the elements of from to , giving:

.

where is the renumbered sequence.

Note the exponent in the exponential -- the displacement by H. Expanding this out, we see that we have

.

.

and thus a regular IDFT (sans the normalization factor) on the right.

However, by the Fourier shift theorem, the multiplication of the spatial-domain data by is equivalent a cyclical shift of by H. Namely, it corresponds to transforming . We can cancel the effects of this shift by cycle-shifting the other way, forming and taking the inverse DFT of it multiplied by (to account for the normalization factor).

There's one final point: the given formula was for numbered from to . However, the (I)DFT is usually done with the numbering from to . This is not a problem: if we use a regular (I)DFT algorithm, we'll get through followed by through . A simple right cyclic shift by resolves this and gives the data in the correct order, though such is not really needed for evaluating transcendental functions.

Then to transform from the spatial domain back to the frequency domain, we do all that in reverse: left cycle-shift by , preform forward DFT, divide by , then cycle-shift the result right by and renumber.

Log-power of base and final integral

In the given program, I lump these two steps together. The end result of the last step should be a series of coefficients giving an approximation to the exponential of the continuum sum of :

.

We can now multiply by , giving

and integrate, to get

.

(YES, I know I'm abusing the integral notation with the "z" in both the limits and the variable, but it's to try to make it clearer and more consistent.)

We can then composite this with the periodizing function to get a periodic function out the end with the period we desired, and a pointwise evaluation and DFT will give us the new Fourier series for the next iteration cycle. The normalization step (for the derivative-at-0 bit) is real easy, just evaluate at 0 and divide the thing by the result.