It may seem obvious when pointed out, but Z8 is slower than Z((Z2)2)2.
It all depends on your math library - if you look, most "integer power" routines, rather than doing:
result = 1
for i = 1 to N
result = result * Z
&c.
That is why I do not use a math library. I simply code my own.
The internal
prioritising of compilers and interpreters is not always published, so it takes time to familiarise oneself with other peoples' products. I prefer to move in, get the results and move on, with no fuss.
The nested squaring makes all power-of-two accessible. So I would not have gone for Z
500 but rather Z
512, for example - in the example from eNZedBlue:
http://i19.photobucket.com/albums/b199/Stormfronter/MandelbrotPowerOf500Detail.jpgTwelve more powers may make a difference, but it is unlikely to be much.
Another concept, of course, is to make the exponentiation into a pastiche of the multiplication. For numbers up to 255
Register AH has the power, Register AL has nil.
Store Z
Shift right AX
Multiply Z by Z and store
If AH=0 then escape
Shift right AX
Multiply Z2 by Z2 and store
If AH=0 then escape
.........
After escaping, one will have the highest binary power in the registers, and all the half-powers and quarter-powers as well
Now one adds AL to itself (or shifts left). The top bit is lost. Thereafter:
Shift left AL
If carry, then multiply result by previous stored result
If AL is zero, then escape (DONE)
Shift left AL
.........
These are loops, of course. I opened them out to show the sequence of events. There would be seven repeats in the first loop, giving Z
0 up to Z
128. Thereafter, there might be seven further multiplications - making a total of fourteen.
So with a maximum of fourteen multiplications, one can raise a complex number to the power of anything up to 255.
To do fast exponentiation of complex numbers, I convert to polar co-ordinates and then multiply the polar angle by the exponentiation power, raise the vector length by the power, and then convert back to Cartesian co-ords. This relies on the geometric property of complex multiplication of two numbers on the complex plane being equivalent to adding the angles and multiplying the lengths of their polar representation.
I read here on these forums that the
Glynn set is Z to the power of
one-and-a-half plus the vector.
If it is so, it is tricky. There are
TWO square-roots, so one needs the correct one when multiplying by Z. Seen as a de Moivre polar manoevre, the angle should be
added, giving one-and-a-half. If one makes a mistake, one
subtracts and gets Z to the power
a half.
Working with polar co-ordinates avoids such mistakes. Indeed, it would be quicker but for the
VECTOR. Given
ZZq, where q is some quantity, we just multiply angle by q and raise the range to the power of q. Given Given
ZZq + Zvector, we are in trouble. It is very tedious to convert back to Cartesian, using arcsine, arccos, arctan or whatever, and using the logarithm.
There is also - for the logarithm - the
Problem of Multiple Solutions to consider.
I suspect that the Glynn set might be
ZABS(Z)3/2 + Zvector.
Yes - even though we have Z to the power of 500 to the power of n, it is still in the family
, which is
exponential exponentiation. Z is exponentiated by m (which is 500), in turn exponentiated by n, the palette count.
Sunset on the Fractals seems to appear when one tries Mandelbrot for the first iteration
(Z2), tribrot for the next
(Z3) and tetrabrot, pentabrot and on - giving an initial term going Z
2, Z
6, Z
24. That is the FACTORIAL exponentiation I explored elsewhere.
It came as quite a surprise to me, though, that this image (Z to the 500) is not more of the old, but introduces shapes not seen in the lower sets.
Charles