fractal perturbation maths summary

the other part of the thing that K I Martin's sft_maths.pdf popularized was that iteration of [3] gives a polynomial series in c:

[6]: z_n = \sum A_{n,k} c^k

(with 0 constant term). This can be used to "skip" a whole bunch of iterations, assuming that truncating the series doesn't cause too much trouble(*)

substituting [6] into [3] gives

[7]: \sum A_{n+1},k c^k = 2 Z \sum A_{n,k} c^k + (\sum A_{n,k} c^k)^2 + c

equating coefficients of c^k gives recurrence relations for the series coefficients A_{n,k}, see mathr.co.uk/blog/2016-03-06_si

(*) the traditional way to evaluate that it's ok to do the series approximation at an iteration is to check whether it doesn't deviate too far from regular iterations (or perturbation iterations) at a collection of "probe" points. when it starts to deviate, roll back an iteration and initialize all the image pixels with [6] at that iteration

fractal perturbation maths summary

optimization: if S underflowed to 0 in unscaled double, you don't need to calculate the + S w^2 term at all when Z is not small. when Z is small you need the full range S (floatexp)

optimization: similarly you can skip the + d if it underflowed.

optimization: for higher powers there will be terms involving S^2 w^3 (for example), which might not need to be calculated due to underflow.

ideally these tests would be performed once at rescaling time, instead of in every inner loop iteration (though they would be highly predictable I suppose).

fractal perturbation maths summary

[1]: Z -> Z^2 + C

perturb the variables with unevaluated sums
[2]: (Z + z) -> (Z + z)^2 + (C + c)

do symbolic algebra to avoid the catastrophic absorption when adding tiny values z to large values Z
[3]: z -> 2 Z z + z^2 + c

scale the values to avoid underflow (substitute S w = z and S d = c)
[4]: S w -> 2 Z S w + S^2 w^2 + S d

cancel out one scale factor S throughout
[5]: w -> 2 Z w + S w^2 + d

choose S so that |w| is around 1. when |w| is at risk of overflow (or underflow), redo the scaling; this is typically a few hundred iterations as |Z|<=2.

now C, Z is the "reference" orbit, computed in high precision using [1] and rounded to (unscaled) double, which works fine most of the time. c, z are the "pixel" orbit, you can do many of these near each reference (e.g. an entire image).

problem: if |Z+z| << |Z| at any iteration, glitches can occur. See fractalforums.com/announcement
solution: retry with a new reference, or (only works for some formulas) rebase to a new reference and carry on

problem: if |Z| is very small, it can underflow to 0 in unscaled double in [5], so one needs to do a full range (e.g. floatexp) iteration at those points. It also means that |w| can change dramatically so rescaling is necessary. See fractalforums.org/programming/

Turns out glitch detection was fine all along. The problem was transiting via low-range double between the series approximation output and perturbation input, thus the values underflowed to 0 causing problems. Passing through the extended range doubles ("floatexp", with a wider exponent stored separately) instead of converting fixed this bug.

Speed report: in one location, scaled double takes about 2/3 the time as x87 long double, and 1/4 the time as floatexp. Nice acceleration, albeit as yet only for power 2 and power 3 (untested so far) Mandelbrot set formula.

Got scaled iterations partly working. Only the code path without derivatives or SIMD so far.

Some trouble with glitch detection though :( Seems some glitches are not detected, leading to bad images...

Debugging this is painful because it's in an XSLT file that generates vast amounts of C++ code (all the inner loops for all the formulas) that takes over 10 minutes to compile.

Took a couple of days of coding, and resulted in my biggest commit to KF in quite a while:

28 files changed
1489 insertions
926 deletions

I refactored the reference orbit storage into double precision plus floatexp (double precision with extended exponent) for only the iterations that need it, in preparation for adding scaled perturbation computations as described by Pauldelbrot in:
fractalforums.org/programming/

It seems to work ok, after some false starts with off-by-one in series approximation, but the extra logic involved in fetching reference data in the perturbed calculations probably slows it down a fraction (I didn't benchmark yet).

If I manage to complete the second phase, the calculation efficiency for zooms beyond the range of (long) double precision (1e308 or so for GPU, 1e4900 or so for x87 CPU) should be very significant, because the current floatexp renormalization after every arithmetic operation is super slow.

as seen on mailing list:

--8<--
of whose is approaching (june 1st 2021).

Vortex Music Journal | v.9 n.2, 2021 | Call for Papers
“A quarter of century of Pd: past, present and future”.

Guest editor: Dr. Alexandre Torres Porres.

- Full Call: vortex.unespar.edu.br/call_v9_
--8<--

kf-2.15.2.2 released with some small but important bugfixes
get it from mathr.co.uk/kf/kf.html#kf-2.15

- new: entropy colouring example palette in OpenGL GLSL
- fix: tiling seams with certain colouring algorithms in OpenGL GLSL
- fix: checkbox to disable power 2 Mandelbrot derivative based glitch test (failing location reported by Microfractal)

Experimenting with colouring for : for each pixel, normalize a neighbourhood's smooth iteration count so the minimum is $0$ and the sum is $1$, then compute $E = \frac{ \sum x \log x }{ \sum 1 }$. Substitute $0$ for $0 \log 0$.

Without jitter I got some strange grid artifacts that looked really bad, especially when animated, with jitter the image is so noisy I need tons of samples to smooth it out, which also means I can't use fast-changing palettes in the exterior because the averaging turns them to mud.

This video is with 100 samples for entropy calculations to get each colour sample, and 100 colour samples per pixel.

claude boosted

Do you want to learn to stream? I've made a step by step guide that covers how to set up and use OBS to stream to Twitch. It covers how to route audio from whatever application to OBS. There are sections on Windows, Mac and Linux.

This is aimed at beginners to streaming (specifically students in my classes) and I would *love* it if you tried it out and sent me your questions. Or did I get something wrong? Let me know! Your questions and complaints will make this more useful to everyone.

If you are a windows users, I would also be extremely happy if you replied with screenshots of what the audio configuration looks like.

claude boosted

ArtFutura 2021 London

Festival of Digital Culture and Creativity

Thursday 15 – Sunday 18 April 2021

Presented online at Iklectik, Music Hackspace and Watermans Art Centre
ArtFutura has established itself as one of the most important international events dedicated to Digital Art, Virtual Reality and Computer Networks. Since the 1990s it has been bringing together artists, academics, students and audiences to experience cutting edge New Media Arts.

PROGRAMME
Thursday 15 April Iklectik
iklectikoffsite.org/artfutura-

Saturday 17 April at Watermans
Sunday 18 April at Watermans

Supported using public funding by
Arts Council England

mathr.co.uk/zoomasm/ zoomasm 3.0 released

is a zoom video assembler which works from EXR keyframes in exponential map format, as output by software including Kalle's Fraktaler 2 +.

New in 3.0 is support for KFR/KFP parameter files containing OpenGL GLSL colouring algorithms, so you don't need to do anything fiddly to get your new colourings from KF 2.15.2 or later to work - you can load the files directly in zoomasm's Colour window.

kf-2.15.2.1 released, tested on both my ancient NVIDIA laptop and modern AMD desktop. Some shaders fail on laptop due to being too big/complicated for the hardware, but some do work.

get it from
mathr.co.uk/kf/kf.html#kf-2.15

Bugs have been reported, and indeed shader compilation fails with NVIDIA drivers. Works ok on AMD. Shame on me for not testing on my ancient laptop with NVIDIA GPU before release...

kf-2.15.2 released with colouring support (design your own colouring algorithms to post-process the calculated raw fractal iteration data)

Get it from mathr.co.uk/kf/kf.html#kf-2.15

is () for (and via additional programs like and others)

and builds are provided, it is technically possible to compile for but I couldn't get the resulting binary to work on my device. It's a that runs fine in on (where I do my coding). builds seem to be blocked on what might be a bug in a third party library.

claude boosted

Wurgo (4k fractal zoom music video) (5m15s)

Wurgo - The Making Of with kf and zoomasm (13m43s)

Demo of the GLSL colouring support in kf-2.15.2 + zoomasm-3.0 (still not released yet)

(sorry for youtube, still searching for a better host...)

Nearly finished kf-2.15.2 and zoomasm-3.0. Will probably release next week after final testing.

The main new feature in is being able to define your own colouring algorithms in OpenGL shader language (). The shader fragment can get raw computed data from KF, such as (smooth) iteration count and analytic distance estimates, and return a colour for the pixel.

There is also an emulation of the previous CPU colouring algorithm, which is modularized so you can use parts of it in your custom shaders.

The main new feature in is being able to load palettes from KF that use OpenGL GLSL colouring shader fragments, so you don't have to repeat work. This includes support for the list-of-colours palette and the other variables in KF's colour dialog.

claude boosted

ArtFutura Festival
15-18 April
various venues
online