How Perturbation Theory and the Taylor Series Make Extreme Zooms Possible
One of the most common assumptions about deep fractal rendering is that failures at extreme zoom levels are simply due to insufficient numerical precision. Use floats instead of doubles, and things break. Use doubles instead of floats, and things improve. Push further with quad precision, and the problem will surely go away.
In practice, it doesn’t.
Mandelbrot Metal goes well beyond standard double-precision by using Double-Double precision arithmetic (see the end of the article for an explanation of Double-Double math) to extend numerical accuracy deep into the fractal. This allows exploration far beyond what most real-time renderers can handle. But even Double-Double precision eventually fails — not because the math is wrong, but because of how floating-point arithmetic behaves at extreme scales.
To go further, we need a different approach. That approach is perturbation theory, powered by a Taylor series expansion.
1. The Precision Wall: Why Even Double-Double Eventually Fails
Let’s start with the basic iteration used to generate the Mandelbrot set:
z(n+1) = z(n)² + c
At modest zoom levels, floating-point arithmetic works well. But as magnification increases, two things happen:
- Coordinates in the complex plane become extremely small.
- Iterated values of z become extremely large.
Eventually, each iteration involves subtracting or adding numbers that differ by many orders of magnitude. When two nearly equal floating-point numbers are subtracted, catastrophic cancellation occurs — most significant digits are lost, and relative error explodes.
Double precision offers about 15–16 decimal digits of accuracy.
Double-Double arithmetic extends this to roughly 31–32 digits.
That buys you time — but not immunity.
At magnifications approaching 10¹⁴–10¹⁶× and beyond, even Double-Double arithmetic loses meaningful precision in the per-pixel iteration. The fractal geometry becomes numerically unstable, long before it becomes mathematically undefined.
The key insight is this:
The problem is not insufficient precision.
The problem is performing unstable operations repeatedly.
2. Why “Just Use More Precision” Doesn’t Scale
In theory, arbitrary-precision arithmetic could push this wall further out. In practice, it’s not viable for real-time GPU rendering:
- Arbitrary precision is expensive to emulate
- Memory bandwidth explodes
- SIMD (Single Instruction Multiple Data) efficiency collapses
- Interactive rendering becomes impossible
Modern GPUs — including Apple Silicon — are designed for wide parallelism, predictable math, and stable numeric ranges. They are not designed to brute-force an arbitrary precision per pixel.
So instead of asking “How many digits do we need?”, the better question is:
How can we reorganize the math so that precision loss doesn’t happen in the first place?
3. The Key Observation: Nearby Points Behave Almost the Same
At deep zooms, every pixel represents a point extremely close to its neighbors in the complex plane.
That means:
- Their orbits start almost identical
- They stay close for many iterations
- Their divergence is small — until it isn’t
Instead of computing each orbit independently from scratch, we can:
- Choose a single reference point
- Compute its orbit very accurately
- Track how nearby points deviate from that orbit
This idea leads directly to perturbation theory.
4. Perturbation Theory for the Mandelbrot Set
Let:
- c₀ be a reference point in the complex plane
- z₀(n) be its orbit
- c = c₀ + δc be a nearby pixel, where δc is a small deviation from c
- z(n) = z₀(n) + δz(n)
Substitute into the Mandelbrot iteration:
z(n+1) = (z₀(n) + δz(n))² + (c₀ + δc)
Expanding exactly would reintroduce large terms and compromise numerical stability, defeating the purpose.
This is where the Taylor series comes into play.
5. Where the Taylor Series Comes In (And Why It’s Essential)
We treat the Mandelbrot iteration as a function:
f(z) = z² + c
Instead of expanding the function exactly, we approximate it locally using a first-order Taylor expansion around the reference orbit:
f(z₀ + δz) ≈ f(z₀) + f′(z₀) · δz
What the Symbols Mean (Taylor Expansion)
The equation f(z₀ + δz) ≈ f(z₀) + f′(z₀) · δz is a first-order Taylor approximation. Each symbol has a precise and intuitive meaning:
f(z)
- f is the function being iterated.
- For the Mandelbrot set: f(z) = z² + c
This function defines how each point evolves from one iteration to the next.
z₀ (z-zero)
- z₀ is the current value of the reference orbit at a given iteration.
- It is computed with very high precision (Double-Double in Mandelbrot Metal).
- Think of it as the “anchor” trajectory shared by nearby pixels.
δz (delta z)
- δz means “a small deviation from the reference value.”
- It represents how far a nearby pixel’s orbit differs from the reference orbit at that iteration.
Mathematically: δz = z − z₀
In deep fractal zooms, δz is extremely small — often many orders of magnitude smaller than z₀.
f′(z₀) (f-prime of z-zero)
- f′ denotes the derivative of the function f.
- It measures the sensitivity of the function to small changes near z₀.
For the Mandelbrot function: f′(z) = 2z. So: f′(z₀) = 2 · z₀
This tells us how strongly a small deviation δz will grow (or shrink) in the next iteration.
≈ (approximately equal)
- This symbol means the expression on the right is an approximation, not an exact equality.
- Higher-order terms (δz², δz³, …) are intentionally omitted.
This is valid because δz is very small in the local neighborhood of each pixel.
What the Equation Is Saying (In Plain English)
The value of the function at a nearby point is approximately the value at the reference point, plus a correction proportional to how far away that point is.
In fractal rendering terms:
- We compute the exact orbit once (z₀).
- We track only small differences (δz).
- We update those differences using the local slope of the function.
This avoids recomputing large values and prevents numerical instability.
Why This Matters for GPUs
This Taylor-based update:
δz(n+1) = f′(z₀(n)) · δz(n) + δc keeps all per-pixel math in a stable, small-magnitude regime, which is:
- Numerically robust
- SIMD-friendly
- Ideal for real-time GPU execution
For the Mandelbrot function:
f′(z) = 2z
This gives us a compact and stable update rule for the perturbation:
δz(n+1) = 2 · z₀(n) · δz(n) + δc
This equation is the heart of perturbation rendering.
Why this works
- All large values stay in the reference orbit
- The GPU only handles small deltas
- Numerical cancellation is avoided
- Precision requirements drop dramatically
- SIMD efficiency is preserved
Instead of fighting floating-point limits, we sidestep them.
6. Why First-Order Taylor Expansion Is Enough
You might ask: why stop at first order?
Because δz is tiny.
At pixel-scale offsets, higher-order terms contribute insignificantly before escape occurs. First-order perturbation provides an excellent balance of:
- Accuracy
- Stability
- Performance
Higher-order perturbations exist, but for real-time interactive rendering, they rarely provide sufficient benefit to justify the cost.
7. How This Maps Perfectly to the GPU
This approach aligns naturally with GPU architecture:
- One high-precision reference orbit (computed once)
- Millions of lightweight perturbation threads
- Identical math across pixels
- Minimal branching
- Stable numeric ranges
In Mandelbrot Metal, the reference orbit is computed using Double-Double precision, while the GPU efficiently and reliably evaluates perturbations in parallel.
Precision is used where it matters most — and avoided where it causes trouble.
8. Putting It All Together in Mandelbrot Metal
At a high level, the pipeline looks like this:
- Compute a high-precision reference orbit (Double-Double)
- For each pixel:
- Compute δc
- Iterate δz using the Taylor-based perturbation equation
- Detect escape using the combined state
- Normalize escape values
- Apply palette lookup via GPU LUTs
The result is stable, interactive exploration at zoom levels that would otherwise be unreachable in real time.
9. Precision vs Stability: The Real Lesson
Double-Double precision is powerful — and necessary.
But it’s not sufficient on its own.
Precision delays failure.
Stability prevents it.
Perturbation theory, grounded in a Taylor series expansion, is what ultimately makes extreme fractal zooms practical on modern GPUs.
Final Thought
At extreme zoom levels, fractals don’t fail because the math is wrong.
They fail because numbers are.
Understanding why — and how to work around it — is what makes deep fractal exploration possible.
Learn more in the Technical White Paper.
Extra Credit: What Is Double-Double (DD) Arithmetic Anyway?
Double-Double arithmetic represents a number as the unevaluated sum of two doubles:
x = hi + lo
Where:
- hi stores the leading significant digits
- lo stores the rounding error
Using error-free transforms, arithmetic operations preserve roughly twice the precision of a standard double — about 31–32 decimal digits — without requiring true 128-bit hardware support.
Why use Double-Double?
- Much higher precision than Double
- Still relatively fast
- Works well for reference orbits
- Supported efficiently on modern CPUs
Why not use it everywhere?
- Still finite precision
- More expensive than standard doubles
- Doesn’t solve catastrophic cancellation by itself
- Not ideal for per-pixel GPU workloads
In Mandelbrot Metal, we use Double-Double arithmetic strategically — where accuracy matters most — and combine it with perturbation theory to achieve both correctness and performance.
Learn more in the Technical White Paper.
Get Version 2.2.3 